You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the app is in the foreground, received notifications are processed by the FirebaseMessagingService onMessageReceived method and displayed within the app. However, when the app is in the background or is closed, received notifications are sent to the notification tray and it is necessary to click each one for it to be processed and displayed within the app.
It would be better if we could find a solution for which the onMessageReceived method is called whenever a notification is received regardless of the state of the app. That way we can guarantee that we persist the notification without having to click each one individually or in case the user dismisses the notification.
It is possible for onMessageReceived to be called while the app is in the background, see https://stackoverflow.com/a/39867458. However, it may not be possible while the app is closed.
One such improvement that I attempted but failed with was upon launching the app to process/persist all active notifications. That would at least eliminate the need to click on each notification, only on one of them. However, it is not possible to access the intent.extras content that way (which contains the encrypted message) - it is only accessible when launching the app from clicking on an individual notification.
Another idea that I had was if the app is running or in the background, we may be able to prevent the notification message from being shown in the notification tray and instead process the data message and then broadcast a notification showing the decrypted message content.
The text was updated successfully, but these errors were encountered:
When the app is in the foreground, received notifications are processed by the FirebaseMessagingService onMessageReceived method and displayed within the app. However, when the app is in the background or is closed, received notifications are sent to the notification tray and it is necessary to click each one for it to be processed and displayed within the app.
It would be better if we could find a solution for which the onMessageReceived method is called whenever a notification is received regardless of the state of the app. That way we can guarantee that we persist the notification without having to click each one individually or in case the user dismisses the notification.
It is possible for onMessageReceived to be called while the app is in the background, see https://stackoverflow.com/a/39867458. However, it may not be possible while the app is closed.
One such improvement that I attempted but failed with was upon launching the app to process/persist all active notifications. That would at least eliminate the need to click on each notification, only on one of them. However, it is not possible to access the intent.extras content that way (which contains the encrypted message) - it is only accessible when launching the app from clicking on an individual notification.
Another idea that I had was if the app is running or in the background, we may be able to prevent the notification message from being shown in the notification tray and instead process the data message and then broadcast a notification showing the decrypted message content.
The text was updated successfully, but these errors were encountered: