Le-roy Staines
Le-roy Staines

Reputation: 2057

Azure Notification Hubs - Registration frequency?

My question is how often do I have to register with GCM for push notifications?

I've seen references to it saying you "dont have to do it very often" but that is pretty ambiguous as it implies I have to do it more than once.

Exactly WHEN do I have to register? Because I want it to always be registered but I don't want to have multiple simultaneous registrations.

Thanks in advance.

Le-roy

Upvotes: 1

Views: 204

Answers (1)

efimovandr
efimovandr

Reputation: 1604

The thing is you should keep GCM Registration Id actual but not create new Azure NH registrations. Typically, to reach that goal each time when application starts it should obtain GCM Registration Id and then update NH registration or create one if not exists.

Azure NH SDK for Android keeps NH registration(s) on device and performs all required checks, so developer should just call hub.register(gcmRegistrationId) each time application runs and obtains GCM Registration Id.

Upvotes: 2

Related Questions