Question

I use Notification Hubs to send Notifications to IPhone and Windows Store app. The IPhone is working perfectly fine, but there is some issue with Windows Store when sending the notification.

Error: The Push Notification System handle for the registration is invalid.

Template:

String WindowsTemplateStr = @"<toast><visual><binding template=""ToastImageAndText03""><image    id=""1"" src=""https://"" alt=""Customer""/><text id=""1"">$(headlineText)</text><text id=""2"">$(bodyText)</text></binding></visual></toast>";

I use this code to register:

registration = await hubClient.CreateWindowsTemplateRegistrationAsync(userDeviceInformation.ChannelUri, Templates.WindowsNotificationTemplate, new string[] { userDeviceInformation.InstallationId, userDeviceInformation.UserName });

The registration goes through fine and I can see the tags properly associated using "Service Bus Explorer".

When I try to send the Notification this is what I do:

notification.Add("src", ImageUrl);
notification.Add("headlineText", String.Format("Message from {0}", fullName));
notification.Add("bodyText", String.Format("Message {0}", message));

When the notification is sent, nothing is received on the device; and I see the registration is also being deleted.

I can't seem to find what is causing this behavior.

Any ideas ?

Was it helpful?

Solution

If WNS returns invalid handle then the corresponding registration will be removed from the notification hubs.

You can use test send to check the error details: http://msdn.microsoft.com/en-us/library/microsoft.servicebus.notifications.notificationhubclient.enabletestsend.aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top