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!
var payload = '{ "message" : "My message", "badge" : 100 }';
, also you will need to make sure your device's template (if you are using one) has a badge property in there. Finally, when the device registers for push notifications, make sure you add theUIRemoteNotificationType.Badge
setting (for iOS 8.0+) – hvaughan3