3

我想开发一个使用推送通知的 Windows Phone 应用程序。我知道我的应用程序应该做的第一件事就是注册到 mspn 并获取 uri。我怀疑,每次应用程序关闭然后重新启动时,uri 是否会不断变化。

4

2 回答 2

2

It should stay the same if you open/close your app. I've had an app using push notifications on the marketplace for a few months now and my URI for it hasn't changed. I'd follow MSDN and subscribe to the ChannelUriUpdated event just in case the channel does change (I'm unaware of the reasons why it would change however):

// Register for all the events before attempting to open the channel.
pushChannel.ChannelUriUpdated += new EventHandler<NotificationChannelUriEventArgs>(PushChannel_ChannelUriUpdated);


void PushChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
{
    // e.ChannelUri contains your updated notification channel - you can pass this to your web service
}
于 2012-05-24T15:21:55.860 回答
2

通知 URL 应该* 在您的应用重新启动时保持不变。

*其他因素可能会起作用,例如卸载和重新安装可能会导致更改。

于 2012-05-24T15:09:35.863 回答