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:
- What to do now as far as I don’t get normal instructions in docs and recreation of push channel return same url
- How do i realize that expiration happend on client side? As far as in real world runtime phone just will stop receiving messages and wont know that something happend…
Thank you
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
ChannelUridoesn’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 theID_CAP_IDENTITY_DEVICEcapability2. Setup a
HttpNotificationChannelon the phone and receive aChannelUri.3. Send the unique device identifier and the
ChannelUrito your server.4. Subscribe to
ChannelUriUpdatednotifications on theHttpNotificationChannel. Anytime this event fires send re-send the device id /ChannelUripair 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.