1
votes

There's a very few examples on the web showing how to work with Notification Hub and android. Besides that, it seems that the samples are using a old version of android SDK. I'm trying to use the notification hub with tags (first with android), but I could not find a good resource to learn how to do that. I'm wondering if anyone already did that, and could show me some code.

I'm following this article: http://www.windowsazure.com/en-us/manage/services/notification-hubs/get-started-notification-hubs-android/

but as I said, I would like to notify users according to tags.

I'll appreciate any help.

PS: I'm not a android/java programmer, so a working project will be awesome.

1

1 Answers

0
votes

Are you able to run the get started sample that you linked? Even if they refer to API version 17, it should work the same (you can use Google API 18 without problems).

From the sample code, in order to use tags, simply add your tags in the call:

hub.register(regid, tags); // with tags a list of strings such as ["Yankees", "RedSox"]

Then when you send a notification you have to specify the tag you want to target.

Unfortunately, we do not have the full Breaking news tutorial for Android yet (only Windows and iOS): http://www.windowsazure.com/en-us/manage/services/notification-hubs/breaking-news-dotnet/

The breaking news tutorial does also provide a lot of insights into the things that have to be done for most of tag-based scenarios.