When in the background, apps receive the notification payload in the notification tray, and only handle the data payload when the user taps on the notification.
Is there any way to handle the data payload without user tapping on the notification?
Basing from the FCM docs on Handling Messages:
App state Notification Data Both
Foreground onMessageReceived onMessageReceived onMessageReceived
Background System tray onMessageReceived Notification: system tray
Data: in extras of the intent.
It's not specifically handled ONLY by tapping on the Notification. You may handle it in the onMessageReceived()
. Pretty sure the tap action also depends on how you implement it.
If you intend for it to do something else, do provide more details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With