以下是 WP8 推送通知的代码。
如您在上面的代码中所见,我将pushChannel绑定到shellToast和shellTile。我想知道这是否有效?因为我在MSDN上没有找到任何相关文档。如果可能,并且服务器发送了任何通知,它们会被正确显示吗? 请提供您宝贵的反馈意见。
HttpNotificationChannel pushChannel = new HttpNotificationChannel(channelName);
// Register for all the events before attempting to open the channel.
pushChannel.ChannelUriUpdated += new EventHandler<NotificationChannelUriEventArgs>(PushChannel_ChannelUriUpdated);
pushChannel.ErrorOccurred += new EventHandler<NotificationChannelErrorEventArgs>(PushChannel_ErrorOccurred);
// Register for this notification only if you need to receive the notifications while your application is running.
pushChannel.ShellToastNotificationReceived += new EventHandler<NotificationEventArgs>(PushChannel_ShellToastNotificationReceived);
pushChannel.Open();
// Bind this new channel for toast events.
pushChannel.BindToShellToast();
pushChannel.BindToShellTile();
如您在上面的代码中所见,我将pushChannel绑定到shellToast和shellTile。我想知道这是否有效?因为我在MSDN上没有找到任何相关文档。如果可能,并且服务器发送了任何通知,它们会被正确显示吗? 请提供您宝贵的反馈意见。