quickstart-android
quickstart-android copied to clipboard
onMessageReceived isn't always called
- Android device: Multiple devices
- Android OS version: Multiple OS versions
- Google Play Services version:
- Firebase/Play Services SDK version: 11.4.2
The onMessageReceived method is only called for about 2/3 of the users. It's not because it's in the background because it's a data payload sent from Microsoft Azure, and the method is called for me and the notification displayed when I have the app closed. I know they're reaching the device because I checked the Play Console and they're marked as 'Acknowledged'.
Steps to reproduce:
- Follow the quickstart example and log the onMessageReceived call
- Send a message with a data payload
- See how many of your push notifications are logged
Observed Results:
Only about 2/3 of the notifications end up with a call to onMessageReceived.
Expected Results:
I expected all of the notifications to reach onMessageReceived.
Relevant Code:
<service
android:name=".push.MyFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
public class MyFirebaseMessagingService extends FirebaseMessagingService {
...
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
...
}
Hi @stkq couple questions:
- Are you seeing 3 Acks in the Android dev console but only getting onMessageReceived call twice?
- Is this happening on a particular device or across multiple devices?
- When I say 2/3 I mean 2/3 of thousands of notifications, but yes, for about 1/3 of those notifications, the console says 'Acknowledged' but the onMessageReceived method is not called. For the other 2/3, the console says Acknowledged and the onMessageReceived is called.
- It's multiple devices but when it happens on one device it usually happens multiple times on that device. There's no pattern when it comes to type of device though.
We are having the same issue, and it is a major problem. Any forecast on when is it going to be resolved? Any workaround?
We have same issues with our test devices. Seems like some device manufacturers don't allow notifications in some situations, We are investigating also Take a loook on manufacturers-interfere-with-reliable-notifications
#822
Hi. We have same issue even in release builds. According to FCM diagnostic tool we found out that we received all messages but some of them weren't broadcasted to our app. Any thoughts how to deal with it? To be clear:
- We send high priority push notifications
- We use legacy http protocol
- Push-notifications work fine until device is in doze mode and app is in standby mode. At least this is the only way we as developers were able to reproduce this issue.
- This issue reproduced even if device connected to the charger. How is it possible?
- Indeed it is rare case but it is very important for us because we have calling app.
Im not a bot I just don't talk
I am also working on a calling app, and I am still dealing with the same issue. For me there are random periods of a minute or two where no notifications arrive, and then it works again. For a calling app that is not fine. Did you ever find a work around for this problem @memfis19 ?