First of all, this is not because the application is in the background.
Notifications are sent with a payload of data. The Play console says that the messages are "Confirmed", so they get to the device. For most users, the method onMessageReceived
is invoked, but for a minority, it is not. Why should it be?
AndroidManifest:
<service android:name=".push.MyFirebaseInstanceIDService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
<service android:name=".push.MyFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
MyFirebaseMessagingService:
public class MyFirebaseMessagingService extends FirebaseMessagingService {
...
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
...
}
source
share