With many of our customers, especially on Xiaomi and Huawei devices, we see an 'empty' Bundle after the FCM notification is tapped by the user. The problem is not reproducible for us.
We have a straight-forward implementation of FCM in our Android application. The app is pure Kotlin and we're using this FCM dependency:
com.google.firebase:firebase-messaging-ktx:23.0.3
(latest is 23.1.1).
Out backend sends the data for a notification to FCM. The notification appears properly on the user's device. This works regardless the app is in foreground or background.
With many of our customers, especially on Xiaomi and Huawei devices, we see an 'empty' Bundle after the notification is tapped by the user. We retrieve the Bundle in our Activity like this:
override fun onCreate(...) {
...
intent.extras?.let {
val value = it.getString("ourKey")
// Proceed with value ...
}
...
}
The Bundle 'it' in the let block looks like this in our customer's app:
- Bundle[{profile=UserHandle{0}}]
- Bundle[{startFromLauncher=shortcut}]
- Bundle[{user=0}]
When we test the app, the Bundle looks like this: Bundle[{mobileservices.notificationId=881832c4-5d9d-4489-a33f-3d2c742b5266, google.delivered_priority=normal, google.sent_time=1661335657647, google.ttl=2419200, google.original_priority=normal, gcm.notification.e=1, gcm.n.dnp=1, gcm.notification.sound=default, gcm.notification.title=Titel, data={ourKey="...", ...}, from=751691358542, gcm.notification.sound2=sound, alert={"title" : "Title", "body":"Message"} ... ]
Does anyone have an idea what might be the reason for these 'empty' Bundles?