Reputation: 101
PushSharp version : Version 2.2.1 Issue Description
I am using pushsharp to send push notifications to windows phone app 8.1.
I installed the app on a windows phone and got a channel URI. Using the same channel URI the push notification worked for me.
Then I uninstalled and installed the app again on the windows phone. This gave me an updated Channel URI.
Using the updated channel URI, the push notification fails with the error:"Device Subscription Expired: PushSharp.Windows.WindowsPushService -> <>"
Sample Code
push.RegisterWindowsService(new WindowsPushChannelSettings("package name", "package security identifier", "client secret")); push.QueueNotification(new WindowsToastNotification() .AsToastText01("This is a test notification") .ForChannelUri("https://db5.notify.windows.com/?token=AwYAAADhaxGQuJHxAGCdCOJa+kyrZ012wjF19Zm+VfriKZVxKqM3Dt4kQz9t6EllMZHgiA4oE1uvij2wdiTwItmp7UUnGoAPp3hc9FnLkJqpckt1xQAux/wez++MVGaty0QKRNk="));
Exception
"Device Subscription Expired: PushSharp.Windows.WindowsPushService -> new channel URI"
Upvotes: 2
Views: 234
Reputation: 101
Resolved the issue. The device token was getting url decoded while transmitting from angular UI to pushsharp app. Encoding again helped to gain the actual channel URI.
System.Web.HttpUtility.UrlEncode(DeviceToken);
Upvotes: 1