ale win
ale win

Reputation: 11

windows azure notifications hub TAGS

I'm working with Windows Azure Notification Hub and Android, testing the notifications push service through GCM. I'm using tags, pushing notifications from a Web aplication (back-end) integrated with Windows Azure, and subscribing from an Android App to listen to those tags.

The issue is: I don't know how to unsubscribe from those tags. Even when I restart the app in the emulator and without registering with GCM nor Azure I continue receiving notifications for each tag I have suscribed previously.

Where are these tags stored? how can I stop listening to those tags?

Upvotes: 1

Views: 1796

Answers (2)

SirCapy
SirCapy

Reputation: 295

Also you can remove azure notification hub registration using Visual Studio (server explorer, azure, hubs, remove from device lists).

Also if your GCM regenerated(or expired) notification hub removes registration when trying to send message on non-existent GCM.

P.S. you shouldn't create new registration on hub any time you restart your app. Better way - store regId on device and use it on backand to check if registration exists.

Upvotes: 2

efimovandr
efimovandr

Reputation: 1604

Once you have received Registration Id from GCM it can be used to send messages to your application at any time even if application is restarted.

Basically, when you call NotificationHub.register(...) that Registration Id and tags specified are sent to your Azure Notification Hub (NH). Then when your backend sends a message to tag "A" NH just scans its list of registrations looking for tag "A". Then all registrations with tag "A" are sent with the message via GCM endpoint. So your application receives that message.

To stop receiving notifications you can just call NotificationHub.unregister(...).

Also GCM can expire Registration Id after some time, then NH will figure it out and remove that Id from its DB.

Also if application is not active for 90 days then NH automatically removes Registration Id from DB as expired.

Upvotes: 0

Related Questions