Notification hubs and the dreaded RegistrationAuthorizationException

Notification hubs and the dreaded RegistrationAuthorizationException

Rate This
  • Comments 1

I’ve been playing around with the awesome Windows Mobile Services and Notification Hubs in Windows Azure.

I ran into a problem recently where I couldn’t register for a native notification using Notification Hubs in my Windows Phone app and looking around for a resolution I came across someone else having this exact same issue:

http://social.msdn.microsoft.com/Forums/windowsazure/en-US/d43b0b6d-6c91-4891-8344-ea2a155092de/notification-hubs-call-registernativeasync-returns-registrationauthorizationexception-401?forum=servbus

Luckily for me, since I work at Microsoft, I have a wealth of resources at my fingertips, so I started by asking the team that develops it!

Well, as it turns out, the problem is the Windows Phone emulator and how it sets it’s clock and how often it syncs with the pc to keep that up to date. In turns out, when you try to register for a notification, a security token is generated from the client SDK and if the time settings are different you might be unauthorized, hence the exception I was seeing.

Once I manually set the clock in the emulator, everything started working fine. Problem solved!

I hope this helps you if you ever run into this issue.

Leave a Comment
  • Please add 7 and 4 and type the answer here:
  • Post
  • How did you set the clock in the emulator? Without this, your advice isn't useful

Page 1 of 1 (1 items)