-
Notifications
You must be signed in to change notification settings - Fork 763
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
[Android] getInitialNotification not working #378
Comments
The workaround in #326 (comment) works but only when the app is killed. If the app is in background I still can't get the notification. |
Can't reproduce it in our example project and it also doesn't reproduce in our production app. can you elaborate? maybe it's something with the payload itself? |
@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 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:
|
Can confirm what @jakubkoci stated.
|
Right. It works now. Sorry for the delay and thank you! |
Thanks @jakubkoci , helped alot.. Any idea how to deal with this in server (Admin SDK) environment ? sendMulticast({
notification: { ... }
data: { ... }
android: { notification, data }
// or anything else
}) |
Ok, got it. |
I tried deleting the notification node which is working fine. |
I 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:
Any ideas what could be wrong?
The text was updated successfully, but these errors were encountered: