2015-09-12 62 views
1

我正在开发一个WP-8.1 Silverlight应用程序,并试图通过天蓝色的通知中心注册我的应用程序用于WNS通知服务,但我正在为MPNS注册 代码中没有错误建设和已在WMappmanifest在通知中心更改通知服务WNS也已经更新凭据仍然当我看到在通知中心我的注册就说明MPNS不WNS注册为MPNS而不是WNS

var channel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync(); 

var hub = new NotificationHub(AzureNotificationHubName,AzureNotificationHubCnxString); 
var result = await hub.RegisterNativeAsync(channel.Uri); 

// Displays the registration ID so you know it was successful 
if (result.RegistrationId != null) 
{ 
    PushChannel = channel; 
    PushChannel.PushNotificationReceived += OnPushNotification; 
} 
+0

这有什么更新?即时通讯有同样的问题... –

回答

0

如果你读"Sending push notifications with Azure Notification Hubs on Windows Phone"仔细,那么你会发现第二个音符:

通知中心Windows Phone SDK不支持在Windows Phone 8.1中使用Windows推送通知服务(WNS) Silverlight应用程序。要在Windows Phone 8.1中使用WNS(而不是MPNS),请使用Silverlight应用程序,请遵循通知中心 - Windows Phone Silverlight教程,该教程使用REST API。

有一步一步指导如何启用WP Silverlight应用程序的WNS注册的链接。您需要编写自己的代码来通过REST API进行注册。

下面是指南: https://github.com/Azure/azure-notificationhubs-samples/tree/master/PushToSLPhoneApp

我犯了同样的错误 - 没有看过第二个音符,失去了天试图让注册正确的。

相关问题