Android: 'onNotification' not executing when app is closed and clicked to notification
See original GitHub issue[android]
Hello, when I put app in the background and I get push notification then onNotification is executed as I expect. But when I close app (using android back button) and I get push notification then onNotification is not executed.
I know onNotification is fired from Java in onNewIntent method. But I really need to pass some data from notification into JavaScript when application was closed before and I click on notification.
How to do it?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:11
- Comments:39 (15 by maintainers)
Top Results From Across the Web
Android: 'onNotification' not executing when app is closed and ...
To show alert in android : in your android device -> settings -> App Notification -> select your app name and turn on...
Read more >Start an Activity from a Notification - Android Developers
This is an activity that exists as a part of your app's normal UX flow. So when the user arrives in the activity...
Read more >Handling Incoming Push Notifications in AWS Amplify - Medium
AWS Amplify provides two push notification configuration functions to configure how push ... This process does not open the closed app into your...
Read more >Notifications Not Shown - Mobile Push
See Android Notification Categories for more details. 800. The app is currently In Focus. Keep the app running ...
Read more >Push notification doesn't open specific screen when app is ...
SDK 41. Android / iOS expo-notifications I have a problem where I need to redirect user to specific post when he taps on...
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

shouldnt some of this be in the documentation ? it ended up working for me but its fairly non trivial to understand that you need a specific message format to get a notification displayed and clicked with the app closed to trigger onNotification
Hey @kfiroo @amrdraz I’ve no idea why now is working 😐
This is what I did, I was using firebase endpoint (not working), then I changed to test using the code of @amrdraz (using GCM endpoint), start working, rollback and test again with firebase endpoint, works… 😕
Is possible that switching between endpoint could fix something behind scenes?
Another note is that
datanested insidedatais not required, the next request works on both (GCM, FCM):And from React native:
Thank’s guys for the help!