[Android] getInitialNotification not working
See original GitHub issueI have installed the latest version of this package. I have made the link manually on Android according to the guide.
Everything works: NotificationsAndroid.setNotificationOpenedListener, NotificationsAndroid.setRegistrationTokenUpdateListener, etc. and in iOS also everything is fine.
But PendingNotifications.getInitialNotification() always return N/A (false), so I can’t get the payload when a notification is openen and the app was closed.
I use:
"react-native": "0.60.5",
"react-native-navigation": "^3.1.2",
"react-native-notifications": "^2.1.0"
Any ideas what could be wrong?
Issue Analytics
- State:
- Created 4 years ago
- Comments:8
Top Results From Across the Web
getInitialNotification not working · Issue #3964 - GitHub
Issue The messaging().onNotificationOpenedApp works perfectly fine, when the app is open but is in the background. The messaging().getInitialNotification() ...
Read more >firebase.messaging().getInitialNotification() does not work on ...
My problem was resolved by using API from 3d-party library such react-native-push-notification instead of firebase.messaging().
Read more >messaging | React Native Firebase
getInitialNotification. </>. When a notification from FCM has triggered the application to open from a quit state, this method will return a RemoteMessage ......
Read more >getInitialNotification - Notifee
This API can be used to fetch which notification & press action has caused the application to open. The call returns a null...
Read more >[Resolve]-react-native-firebase: onNotificationOpenedApp and ...
Coding example for the question react-native-firebase: onNotificationOpenedApp and getInitialNotification not working on iOS.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@CristianOspina What service are you using to test it? I had the same problem because I tried to send a notification directly from Firebase console. But this perhaps sends only Notification Message and you have to send Data Message to notification be passed into
onMessageReceivedmethod (see https://firebase.google.com/docs/cloud-messaging/concept-options#notifications_and_data_messages).If I send following HTTP POST request to https://fcm.googleapis.com/fcm/send (via curl or Postman for example) it works for both, the app on the background and killed app:
Headers:
Body:
I tried deleting the notification node which is working fine. But unable to get notification image after removing. any idea?