Registered for MPNS instead of WNS

116 Views Asked by At

I am developing a WP-8.1 Silverlight App and am trying to register my app for WNS notification service through the azure notification hub but am getting registered for MPNS instead there is no error in the code while building and have changed the notification service in WMappmanifest to WNS also have updated credentials in notification hub still when i see my registration in notification hub it shows MPNS not 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;
}
1

There are 1 best solutions below

0
Dainius Bekeris On

If you read "Sending push notifications with Azure Notification Hubs on Windows Phone" carefully then you will notice second note:

The Notification Hubs Windows Phone SDK does not support using the Windows Push Notification Service (WNS) with Windows Phone 8.1 Silverlight apps. To use WNS (instead of MPNS) with Windows Phone 8.1 Silverlight apps, follow the Notification Hubs - Windows Phone Silverlight tutorial, which uses REST APIs.

There is link to step by step guide how to enable WNS registration for WP Silverlight application. You need to write own code to register through REST API.

Here is that guide: https://github.com/Azure/azure-notificationhubs-samples/tree/master/PushToSLPhoneApp

I made same mistake - haven't read second note, lost days trying to get registration correct.