0

我这个link昨天跟随收到关于我的Windows 8.1手机应用程序从蔚蓝的通知中心通知,这是工作,但通知中心RegistrationAuthorizationException

但今天是扔我这个错误

An exception of type 'Microsoft.WindowsAzure.Messaging.RegistrationAuthorizationException' occurred in mscorlib.ni.dll but was not handled in user code 

Additional information: HTTP request failed. 



HTTP Details: 

Status: 401 

Reason: Unauthorized 

Full content: <Error><Code>401</Code><Detail>ExpiredToken: .TrackingId:e27f22fb-5c9c-4028-8594-eacb71e5a35e_G1,TimeStamp:4/14/2016 10:29:33 AM</Detail></Error> 

这是在我App.xaml.cs的InitNotificationsAsync方法抛出此异常时,我的应用程序试图注册

private async void InitNotificationsAsync() 
    { 
     var channel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync(); 

     var hub = new NotificationHub("nameofhub", "myconnectionstring"); 
     var result = await hub.RegisterNativeAsync(channel.Uri); 

     //Displays the registration ID so you know it was successful 
     if (result.RegistrationId != null) 
     { 
      var dialog = new MessageDialog("Registration successful: " + result.RegistrationId); 
      dialog.Commands.Add(new UICommand("OK")); 
      await dialog.ShowAsync(); 
     } 

    } 
+0

您在Azure上使用哪种服务?如果它是您正在使用的新App Store容器,那么您应该按照以下步骤操作:https://azure.microsoft.com/zh-CN/documentation/articles/app-service-mobile-windows-store-dotnet-get-开始推/ – JTIM

回答

0

你在模拟器中尝试它还是..? 它可以是时间同步。 如果这是模拟器,你可以检查时间并手动设置它吗?

+0

我从模拟器卸载应用程序,再次部署,工作正常,但几个小时后,同样的事情发生 –

+0

它开始看起来像它不是时间问题,但你可以请检查本地机器时间和模拟器的时间?从你的回答中不清楚。你有没有尝试将它部署到真实的设备,并看看它是怎么回事? –

+0

时代不一样 –