-
Notifications
You must be signed in to change notification settings - Fork 35
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
Receive pushes when app is closed #1
Comments
Sure, use gcm.getLastData() when the app starts or resumes to retrieve the data from the last push notification and act accordingly in your app. See the example for how this could work. |
What I'd like to do is pop up a notification while the app is still closed, prompting them to open it. Is this possible? |
Well, the notification will be shown in the normal way (either at the top, or as a alertbox you have to click to open the app / dismiss it) If you click it, the app will open / resume and then you should use gcm.getLastData() to do anything specific to process the data in the notification itself. |
The problem I'm having is that I don't get anything on my device (in the tray or an alert) from the push until I open the app. |
Do you see the notification being received by the app in logcat? |
My app is allowed to show notifications. I don't see anything in logcat that looks like a notification, what should I be looking for? |
Search for "Push notification received" for log category GCMIntentService. |
Digging through logcat helped me find the problem
I had my message key in the payload capitalized
There's half a day I'll never get back. Thanks for all your help! |
Update FCMService.java to properly handle Android O notification channels
Is it possible with this library to receive pushes when the app is closed and out of memory?
The text was updated successfully, but these errors were encountered: