uploader33
uploader33

Reputation: 328

Error in Azure Notification Hub with NotificationHubUnauthorizedException: Unauthorized in Android client

I am trying to add my ASPNET and Android project push notifications. I found this tutorial (http://azure.microsoft.com/en-us/documentation/articles/notification-hubs-android-get-started/). I did the same thing but it gave an error that I couldn't understand why. Can you help me ?

I got error in registerWithNotificationHubs method in Android part. Error: com.microsoft.windowsazure.messaging.NotificationHubUnauthorizedException: Unauthorized

I found this as the same problem thread from last year, It was a bug and resolved, according to the responder, but I couldn't handle it. NotificationHubUnauthorizedException: Unauthorized on Azure Notification Hub registration

PS: I have already allowed any IPs accessing to GCM

Upvotes: 1

Views: 1649

Answers (2)

Abdallah Alaraby
Abdallah Alaraby

Reputation: 2249

In my case I had to configure the phone to use automatic date and time.

Upvotes: 2

efimovandr
efimovandr

Reputation: 1604

There are two places on Azure Management Portal where you can define Shared Access policies and generate keys in context of Notification Hubs - namespace level and notification hub level. By default there is only one root policy defined on the namespace level. That policy has all privileges.

Make sure the connection string you are using contains the key corresponding to the root policy or any other other policy which has Manage privilege.

Upvotes: 0

Related Questions