AzurePushNotificationPlugin icon indicating copy to clipboard operation
AzurePushNotificationPlugin copied to clipboard

Unregistering device from notification hub

Open ChristopherMWood opened this issue 3 years ago • 1 comments

I've been noticing an issue with multiple device registration on Azure notifications hub from using this plugin. I'm not completely sure if my understanding is accurate of what is going on, but it seems that once a device gets registered with Azure hubs, it never gets unregistered from there on out. This creates issues with test devices getting registered hundreds of times during development as well as individuals phones getting registered on production when uninstalling and reinstalling for any reason. Microsofts documentation, shared in the link, shows an example of how to register a phone and shows that unregistering is the first step before trying to register. This way any previous registration is wiped clean. I looked into the repo code and didn't see any code around this.

https://docs.microsoft.com/en-us/azure/notification-hubs/notification-hubs-push-notification-registration-management#example-code-to-register-with-a-notification-hub-from-a-device-using-a-registration

I was able to find the unregister methods in the projects source code but neither of them are accessible or used anywhere else in the project. At least from my github search there were no references past the declarations of the methods. I'm not sure if I'm missing something here in how to prevent duplicate registrations, but I'm currently unable to find a way using this plugin. Any clarity on how that is supposed to be handled, or if a PR is needed to implement it is appreciated. This is an issue that I've found others talking about online to mixed success. Seems like a pretty big documentation/clarification issues on Microsofts end to not make this use case more clear given the number of devices registered to certain tiers of their service is limited making this issue potentially eat up limited resources. Below is another link to a discussion of this issue I found on the Azure github

https://github.com/Azure/azure-notificationhubs-android/issues/5

Any help or clarification is greatly appreciated since it's pretty hard to find reliable info out there about handling this use case.

ChristopherMWood avatar Jan 15 '21 21:01 ChristopherMWood

Also getting this issue. Devices do not unregister from tags even when await CrossAzurePushNotification.Current.UnregisterAsync(); is called.

daniel-wilton avatar Jun 16 '21 13:06 daniel-wilton