Send notifications to individual users using Azure Notification Hub

Elad Lachmi picture Elad Lachmi · Feb 6, 2014 · Viewed 9.5k times · Source

I am creating a Web API back-end for an app. The app is currently planned only for WP8, but we also plan to roll out versions for other platforms at a later time.

We are basing our push notifications on the Azure Notification Hub. The app will not register directly, but will call a Web API method, which will do the registration for the app.

There are two things I am having trouble wrapping my head around:

  1. I can't find any documentation on sending notifications to individual WP8 users. I don't want to broadcast; I just want to send one notification to one user. Is this use-case supported? How can this be done using the Microsoft.ServiceBus.Notifications API?

  2. I found this: http://www.windowsazure.com/en-us/documentation/articles/notification-hubs-aspnet-notify-users/ - This implements a lot of the functionality I need, in terms of notifications. The sample includes only iOS and Windows store apps. Is this because this use case is not supported on WP8? I can't see why, but I'm kind of new to WP8.

Answer

Elad Lachmi picture Elad Lachmi · Feb 9, 2014

Azure notification hubs support tags, as in the example here.

In a Channel9 web-cast (which I can't find right now), they talked about leveraging tags in order to send notifications to specific users/groups.

Since I would like to leverage all the added value of the Notification Hubs, I will tag each entry with the username used in my application, and use that to send norifications to specific users by username.

EDIT: Here in the official Windows Azure documentation I found an example talking about exactly what I was looking to do. As an added bonus, they also gave me the idea to also tag with an installation ID, so you can have the same user getting native notifications on different devices with different operating systems.