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

時代不一樣 –