I’m using Firebase Cloud Messaging (FCM) for push notifications, and I’ve noticed that on my iPad (iPadOS 17), when the network is turned off and then back on, only one notification is delivered, which aligns with the APNs documentation. However, my iPhone behaves differently.
Behavior Observed:
-
iPhone:
- Network off for a short period (5 minutes) > on: All notifications arrive as expected.
- Network off for an extended period (about 8 hours) > on: Only the last notification arrives.
-
iPad (iPadOS 17):
- Network off > on: Only one notification arrives, regardless of the time the network was off.
According to the APNs documentation, only one notification is stored in APNs persistent storage when a device is offline, but I’m curious why the iPhone receives all notifications when the network is off briefly.
Apns Config Code:
Here’s the APNs configuration I’m using with Firebase Admin SDK, and I haven’t made any additional settings in the APNs header.
protected ApnsConfig getApnsConfig() {
return ApnsConfig.builder()
.setAps(Aps.builder()
.setAlert(ApsAlert.builder()
.setTitle(title)
.setBody(body)
.build())
.setSound("default")
.setMutableContent(true)
.setContentAvailable(true)
.build())
.build();
}
What I’ve Tried:
- Changing the notification priority to 5 and 10
- Sending custom messages to avoid compact messages
Is there a way to make sure all notifications are delivered on iPad as well, similar to how it works on the iPhone after a brief network outage? Any suggestions would be greatly appreciated.
Thanks in advance.