First of all, it's not because the app is in the background.
The notifications are sent with a data message payload. In the Play console it says the messages are 'Acknowledged', so they're reaching the device. For most users, the onMessageReceived
method is called, but for a minority, it isn't. Why would this 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) {
...
}