we use the old GCM HTTP server to send push notifications to the app.
when they are received in the app we use the notification builder to show the message:
NotificationChannel mChannel = new NotificationChannel(
"com.....app.notification", "...",
android.app.NotificationManager.IMPORTANCE_HIGH);
mChannel.setShowBadge(true);
mNotificationManager.createNotificationChannel(mChannel);
mBuilder =
new NotificationCompat.Builder(context, mChannel.getId());
mBuilder.setWhen(System.currentTimeMillis())
.setContentTitle(fromHtml(title))
.setTicker(fromHtml(title))
.setContentIntent(contentIntent)
.setAutoCancel(true)
.setPriority(Notification.PRIORITY_MAX);
...
mNotificationManager.notify(appName, notId, mBuilder.build());
all works well, except that on some devices, the push are delivered, only when the user unlocks the screen.
i know that there are several android settings that might allow this or not. but they are too complex and no user could possibly find all of them.
so my question is: is there a way to programaticaly make sure that the push are always shown?