-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Push notification listener is not invoked at all Android #4183
Comments
Hi @vinaynb , Since you're not using FCM for your Android Push Notifications, I'm not sure this is an Expo-related issue. The payload format could be different with AWS SNS. Please take a look at this forum post for a possible solution. Closing as I don't believe this is Expo-related, will re-open if necessary. |
@cruzach i am using FCM for push android notifications just the difference is that it does via AWS SNS and not via Expo Servers. Can you guide me to the required format which i need to take care of when sending notifications.
As i am recieving notifications successfully and the app opens up as well but listener doesn't get called leads me to something wrong happening in expo. |
UPDATE - today i checked the same on iOS and it works so issue is specifically hitting android right now. |
See these Github issue comments, as that seems to be the issue. Not 100% sure if that exact fix will work, but taking a look at our source code for Notifications will let you see the exact payload to model. |
UPDATE {
"GCM": "{ \"data\": { \"message\": \"Sample message for Android endpoints\", \"title\": \"Hello world...\", \"body\": \"msg body\", \"experienceId\": \"@expousername/app-slug\" } }"
}
old json which didn't work (for reference) {
"GCM": "{ \"notification\": { \"message\": \"Sample message for Android endpoints\", \"title\": \"Hello You...\" } }"
} Another issue that i solved with new json was that of double notifications being shown in android. The reason behind that was because of the |
Awesome! And thanks for sharing the fix for others who might run into the same problem 馃槃 |
馃悰 Bug Report
Environment
standalone android
Steps to Reproduce
Notifications.getDevicePushTokenAsync
Expected Behavior
I have copied notifications code from Expo's documentation and implemented in-app. The listener should fire when user opens app by tapping notification.
Actual Behavior
Notification listener is not fired at all even once.
Reproducible Demo
i can provide a repro via snack but that wouldn't be of help in my case as you need to have standalone apk to get device native token as I am not using expo's notifications service.
my listener code is written on root component's
componentDidMount
and i can confirm that it is being called.This issue is very similar to #1997 except that i use aws sns and i am facing this issue on android
The text was updated successfully, but these errors were encountered: