I am using Firebase to send data messages to multiple types of devices (Web, iOS, Android etc) and it seems that setting priority to HIGH does not work in preventing delayed notifications for new messages when using Chrome or PWA (not on native app). Sometimes I do not receive the notifications on my Android phone (Motorola One, Android 10) for even 10 minutes, maybe more (clients reported even 2-3 hours or exactly when accessing the app), if I do not open Chrome or the installed PWA.
This issue doesn't seem to happen on iOS or desktop browser (i used Chrome mostly).
To send message to user's multiple devices I use the same method with Java firebase-admin SDK (version 6.2.0, if that matters):
ApnsConfig apnsConfig = ApnsConfig.builder().
setAps(Aps.builder().setAlert(alertTitle).setCategory("Category1")
.setContentAvailable(true).setMutableContent(true)
.setSound("default")
.build()).build();
AndroidConfig androidConfig = AndroidConfig.builder()
.setPriority(Priority.HIGH)
.build();
message = Message.builder()
.setApnsConfig(apnsConfig)
.setAndroidConfig(androidConfig)
.putAllData(data)
.setToken(token)
.build();
response = FirebaseMessaging.getInstance().send(message);
To check the data on the notification I use a widget that contains Notification Log (add screen widget -> Settings -> Notification Log) which displayes all fields (like pkg, extras, intent etc) and the "priority" field is always DEFAULT (but for example, google chat, facebook messanger, instagram, the prioirty is set to HIGH).
What could be the issue? Is there another way of setting the priority or preventing the long delay for the Chrome/PWA notification alerts?
EDIT: I tried also to set WebpushConfig with .putHeader methods and it doesn't work:
WebpushConfig webPushConfig = WebpushConfig.builder()
// .putHeader("apns-priority", "10")
.putHeader("Urgency", String.valueOf(AndroidConfig.Priority.HIGH))
.putHeader("priority", "high")
.build();
The notifications arrives like this:
