A test push is sent to my device.
When the application is active, the push comes normally and with sound; when the application is minimized, 2 empty push messages arrive and without sound. Even if onMessageReceived left empty, two empty notifications are output anyway.
Class accepting push:
public class MyGcmListenerService extends GcmListenerService implements MyLocation, DownloadListner { @Override public void onMessageReceived(String from, Bundle data) { sendNotificationPushNewMessages(); } private void sendNotificationPushNewMessages() { Intent intent = new Intent(this, MainInfoActivity.class); PendingIntent contentIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); NotificationCompat.Builder b = new NotificationCompat.Builder(this); b.setAutoCancel(true) .setDefaults(Notification.DEFAULT_ALL) .setWhen(System.currentTimeMillis()) .setSmallIcon(R.mipmap.ic_launcher) .setTicker("Hearty365") .setContentTitle("Default notification") .setContentText("Lorem ipsum dolor sit amet, consectetur adipiscing elit.") .setDefaults(Notification.DEFAULT_LIGHTS| Notification.DEFAULT_SOUND) .setContentIntent(contentIntent) .setContentInfo("Info"); NotificationManager notificationManager = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.notify(1, b.build()); } PUSH text
{"to":"cHj0nruQddQ:APA91bHZZ4i02rZA7s8qyEIWtBJE-5PUry-mhAUlUWE0z3XVa4kX4CTxwD9cwWLnp-FbAAwc9zBQMf9Hghwz5B7ym51NVSt_S-9ChHW09E2LfHQyT6mtCgjMkF1fNyvQIAKfguH63ze9","content_available":true,"priority":"high","data":{"type":"push_new_messages","text":"\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430"}} content_available and priority are used for ios version
What could be the trouble? Can a class receive less when the activity is minimized?