I am sending push messages to users using firebase, the puh is working fine when the app is running or when its in the background , but when i kill the app using multitask tray, its not receiving the push on some devices ,but on some devices its working flawlessly , Seems the app is receiving the push but not showing it. I searched SO and found similar problems but with no solution to the problem. As my application is heavily dependent on push messages. Is this any way to implement it? I am using following code to restart the service but nothing happens.
@Override
public void onTaskRemoved(Intent rootIntent) {
super.onTaskRemoved(rootIntent);
// Log.d(TAG, "TASK REMOVED");
PendingIntent service = PendingIntent.getService(
getApplicationContext(),
1001,
new Intent(getApplicationContext(), MyFirebaseMessagingService.class),
PendingIntent.FLAG_ONE_SHOT);
AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
alarmManager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, 1000, service);
}