如果您打开/关闭您的应用程序, 程序应该保持不变 。 我已经在市场上用推推通知应用了几个月了, 我的 URI 还没有改变 。 我跟踪 < a href=" http://msdn. microsoft. com/ en- us/library/ hh202967% 28v=vs. 92%.29. aspx" rel = "nofollow" >MSDN , 并订阅 ChannelUriUriUnded
事件, 以防频道真的改变( 我不清楚它会改变的原因 ):
// 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
}