Azure notification hubs have a feature that allow for subscribing to various topics in a many to many relationship. (many devices to many declared topic strings)

Suppose I take these steps:

  1. I send an iOS device a notification, "test 1".
  2. The device goes offline.
  3. I send "test 2"
  4. I send "test 3".
  5. The device comes back online.
  6. APNS only sends "test 3". Test 2 was dropped

Not to mention that APNS will only notify the most recent event "Test 3", it can also drop additional alerts in iOS 11 if I exceed the 30 maximum per day.

One of the things I like about Azure Hub service, is that I can manage that subscription "state" in an external storage. Now however, it seems I have to track the subscriptions myself, rebuilding part of the Azure HUB architecture... archiving out the subscriptions, topics, etc so the device can query the server for all missing events.

Question

  • How do I reconcile the features of Azure Hub and topic subscription with the issue of dropped APNS pushes?
1

There are 1 best solutions below

0
On

You're correct that there's nothing ANH (or you as a developer) could do about the dropped notifications because that's the way ANPS is designed. Which means that the solution to your problem would really depend on what kind of application you're building, the architecture and user scenarios you're targeting.

A couple of ideas I have in mind which may or may not works for you depending on what you're trying to do are:

  • Send a silent push to the topic once in a while that would trigger the app to query the server on whether something has been missed
  • If the nature of the app is such that people open it often anyway, then you could do a background check at the time they open the app

Of course, in both of these scenarios, you'll have to build some additional infrastructure on your end to keep track of which device received or missed certain notifications. One thing that might help you not to have to rebuild parts of the NH that are already there is using Pet Message Telemetry (PMT). I haven't experimented with dropped notifications, but hopefully, there's a way to tell a dropped vs delivered message apart using PMT (looks like Dropped value of the PnsErrorDetailsUri field is something similar to what you need). And having that might help you simplify and reduce the amount of data you need to keep on your end to be able to tell whether someone had missed a notification or not.