Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(types): add sentTime to FirebaseMessagingTypes.RemoteMessage #3885

Merged
merged 1 commit into from
Jul 6, 2020

Conversation

mikehardy
Copy link
Collaborator

it was already sent and correctly serialized / showing up, just not
available in typescript

https://firebase.google.com/docs/reference/android/com/google/firebase/messaging/RemoteMessage#public-long-getsenttime

Release Summary

fix(types): add sentTime to FirebaseMessagingTypes.RemoteMessage

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
    • Yes
  • My change supports the following platforms;
    • Android
    • iOS
  • My change includes tests;
    • e2e tests added or updated in packages/\*\*/e2e
    • jest tests added or updated in packages/\*\*/__tests__
  • I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • Yes
    • No

Test Plan

I'm using the change directly via patch-package to access the sentTime property in a typescript project, it works


Think react-native-firebase is great? Please consider supporting the project with any of the below:

@mikehardy mikehardy added plugin: messaging FCM only - ( messaging() ) - do not use for Notifications tools: typings TypeScript / Flow Type: Bug Fix labels Jul 6, 2020
@mikehardy mikehardy requested review from Salakar and Ehesp July 6, 2020 06:28
@Salakar Salakar merged commit 0b87a15 into invertase:master Jul 6, 2020
@mikehardy
Copy link
Collaborator Author

Nice to be on v6+ finally, I see something, I fix something, it's available without much patch-hackery :-), thanks for the merge

@mikehardy mikehardy deleted the remote-message-sentTime branch July 6, 2020 15:37
@babyrusa
Copy link

babyrusa commented Jun 2, 2021

hi @mikehardy , I'm unable to see sentTime on IOS from onMessage(async noti => noti.sentTime) function, onNotificationOpenedApp(async noti...) and getInitialNotification(async noti...) is that a normal behavior? It works fine on Android, I was able to grade noti.sentTime but it's null on IOS. Is there a setting I have to set when sending notifications?
Thank you

@mikehardy
Copy link
Collaborator Author

@babyrusa please post come code and console.log results, speculation is inefficient in my experience
It may be that there is a platform different, it may be that there is a bug. Also, you may consult the relevant e2e tests here to see if we are indeed probing it and/or how the tests handle it, that helps move things along the path of figuring out if there is an issue here or not.
It's always possible to make a native quickstart as well - if there is a platform difference - to determine what layer the difference is at - perhaps it is in firebase-ios-sdk (a real platform difference) or just here? https://github.com/firebase/quickstart-ios/tree/master/messaging - alternatively you can reach into the native code here that receives messages and dump the object to console to see if we're just not parsing something for some reason

hmhm2292 pushed a commit to hmhm2292/react-native-firebase that referenced this pull request Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: messaging FCM only - ( messaging() ) - do not use for Notifications tools: typings TypeScript / Flow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants