Question

I am investigating migrating from Azure Mobile Services push notifications to Azure Notification Hubs for two primary benefits: 1) pub/sub architecture using tags, and 2) abstracting the device registration.

However, I'm struggling to understand the pattern for device badge value management.

With mobile services push notifications it's straightforward to maintain the current badge value in the db for individual device registrations. But with Notifications Hubs where Azure maintains the 'subscribed' devices registrations and manages the fan out of device notifications, what is the best approach for the client devices to update their current badge value with Azure Notification Hubs?

I have reviewed the Azure documentation, viewed several of the excellent overview videos, such as Channel 9 Cloud Cover episode 100, but documentation and examples seem to be lacking with regard to Notification Hubs and management of badge values.

Thanks for your help, friends!

Was it helpful?

Solution

Unfortunately badge management is not straightforward in a pub/sub architecture. If you use tags to indicate individual users then you can keep your counter in your backend and then add it in your notification when sending to your hub.

In you are using tags as interest group, then things are not straightforward, and they depend on what you want that count to be. For some platforms (i.e. iOS and ANdroid) you can code some client code that keeps a personalized counter. Some other times however, one has to avoid keeping personalized counters and resort to use generic badges like "!" in Windows 8.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top