-
Notifications
You must be signed in to change notification settings - Fork 121
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
Background android notification #34
Comments
How are sending the notification? Can you paste your code? FCM documentation states that only Data Notifications are caught by the app when in background. Instead Message Notifications are only when app in in foreground. |
Like that:
|
The issue is in the fact that you send the notification as a Message Notification instead of Data Notification.
Here you are setting the title and body of the notification and this is handled automatically by the device to show the notifications. Instead if you need to make the notification show also when the app is in background you need to leave this 2 properties empty and set title and body in the Data property.
This will require you to create a listener in the mobile app which will get the title and body and manually generate the notification. |
If I sent the notification to an individual devices as shown in the documentation, if the app is background and we click on it in the noitification section the app does not open.
I have tried everything, please help!
The text was updated successfully, but these errors were encountered: