kodbuse
kodbuse

Reputation: 1010

Firebase topic-based push notifications and iOS QoS

For regular single-device push notifications through APNS, less important pushes can "replace" more important ones, because if the device is temporarily offline, only the last notification per device/app is retained and delivered with APNS. https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/APNSOverview.html#//apple_ref/doc/uid/TP40008194-CH8-SW5

Let's say I'm delivering critical pushes to single devices, and informational, non-critical pushes via a topic-based pushes in Firebase FCM. Would it still be true that the topic-based pushes could replace the critical pushes for an offline device?

A predecessor of mine left behind a design document that said topic-bases push subscriptions would avoid the problem of informational pushes replacing critical ones, but I haven't found any documentation to support that. I'm thinking I might be better off using websockets or similar (maybe via PubNub) for the the informational pushes when the app is in the foreground, and only use APNS/FCM for the critical pushes. Am I right?

Upvotes: 0

Views: 631

Answers (1)

Craig Conover
Craig Conover

Reputation: 4738

disclaimer: this does not directly address the Firebase topic-based aspect of this question, rather, it provides an alternative solution that has the same features/implementation for both FCM and APNs with respect to QoS, or more specifically, the ability to retrieve messages that might have been missed while offline.

Publish, Persist & Push with PubNub

PubNub Storage Service

Well, putting APNs and FCM aside, PubNub will persist all of your messages for later retrieval when you enable the Storage service. So when devices are offline, they can receive push notifications (APNs/FCM), and whether or not those notifications are received/acknowledged by the end-user, your app can easily retrieve all messages that were sent while the device was offline.

PubNub Mobile Push Service

The other advantage of using PubNub is that you include the APNs/FCM push payloads in the realtime publish payload and if the device is active/online and subscribed to that channel, then it receives the message in realtime. If the device is not subscribed to the channel, it still receives the FCM/APNs push notification.

NOTE: you must enable the Storage service on your PubNub key set and configure the retention as required: 1 day, 3 days, ... 30 days or Unlimited.

Upvotes: 2

Related Questions