以下是WP8推送通知的代码。
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的任何关于此的文档。 如果可以,服务器发送任何通知会正常显示吗? 请就此提出宝贵的意见。
答案 0 :(得分:4)
这是可能的,这是正确的方法。一个应用程序,一个频道,无论您使用多少种推送通知。