Reputation: 499
I have got trouble when i send push notification to phone it returns with this errors:
[X-SubscriptionStatus] => Expired
[X-NotificationStatus] => Dropped
[X-DeviceConnectionStatus] => Connected
From this point i have two questions:
Upvotes: 2
Views: 1452
Reputation: 2735
From the server side there is nothing you can do - you just have to stop sending notifications to that URI.
What you can do is try and make sure your ChannelUri
doesn't expire, or if it changes, notify your server side application of the change. Basic process is;
1. Uniquely identify the phone. A very likely candidate is Microsoft.Phone.Info.UserExtendedProperties.GetValue("ANID")
but be aware it'll require your app to have the ID_CAP_IDENTITY_DEVICE
capability
2. Setup a HttpNotificationChannel
on the phone and receive a ChannelUri
.
3. Send the unique device identifier and the ChannelUri
to your server.
4. Subscribe to ChannelUriUpdated
notifications on the HttpNotificationChannel
. Anytime this event fires send re-send the device id / ChannelUri
pair to your server.
Following this pattern you should always have the correct push notification Uri on your server side, as long as the user periodically runs your application to refresh the push notification channel.
Upvotes: 3