-
Notifications
You must be signed in to change notification settings - Fork 614
Call FirebaseMessagingService#onMessageReceived, the app in the background. #46
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
Comments
Hi, just to clarify, do you mean that for notification messages to call onMessageReceived() at the same time as the notification is shown, or once the user taps on and opens the notification, or something else? |
before notification. I would like to customize notifications using NotificationCompat.BigPictureStyle and NotificationCompat.BigTextStyle. |
@najeira I think what you want to do is send a |
@samtstern Thanks for your reply. I think that using Is there any reason to not provide a means to customize the notifications in the background? |
Same request here! In our usecase we want to be able to update the badge displayed by some launchers, but, as we are not called when the app is in background, we have to use only the data payload, encapsulate the whole notification data in it, use the iOS custom keys to keep it working like before on iOS, and finally handle the notification display on Android manually. I can't see any technical reason to not call |
This is a technical restriction that's outside the scope of the Android SDK. It's really an OS-level decision. Remember, the FCM message is received by the Google Play services process and your process is not always notified. I am going to close this issue as there's nothing that can be done in this repo to fix it. However I will forward on your feedback to the FCM team in case they decided to revisit their decisions on background processing in the future. |
I can not agree with this. Android OS allows us to customize notifications even if apps is in background. It is decision of SDK not to call onMessageReceived, It's written in Instead, please, please remove Without this, I can not move from GCM to FCM. I am in serious trouble. |
It is rare to receive notification when an application is in the foreground. For example, Gmail also displays special notifications. Why are not we allowed? Should I use GCM instead of FCM? |
Hi @najeira and @julien1619 thanks for this feature request. @samtstern is correct that this is a change that has to be made in Google Play Services which currently does not pass display notifications onto the SDK before being displayed. This is something the FCM team is looking into, we would like to have as unified an experience on Android and iOS as possible. @najeira you mentioned '''For example, with topic delivery, iOS and Android can not be separated.'''. You can use the V1 HTTP API to clearly define different notification message payloads. Also GCM does not provide any different functionality here it will be deprecated soon, FCM should be used. |
@kroikie Thanks for your reply. I will try to use Can we implement custom notifications like Gmail? |
What feature would you like to see?
Call FirebaseMessagingService#onMessageReceived, the app in the background.
The text was updated successfully, but these errors were encountered: