【发布时间】:2015-09-10 13:28:50
【问题描述】:
我正在使用 pushsharp 为窗口电话使用标准推送通知代码。 我在设备上收到通知。但问题是每个事件我都会收到多个回调。例如,对于一个通知,我会收到 5 个用于创建通道、通知发送等的回调。
请帮助我哪里做错了。
var push = new PushBroker();
push.OnChannelCreated += push_OnChannelCreated;
push.OnChannelDestroyed += push_OnChannelDestroyed;
push.OnChannelException += push_OnChannelException;
push.OnDeviceSubscriptionChanged += push_OnDeviceSubscriptionChanged;
push.OnDeviceSubscriptionExpired += push_OnDeviceSubscriptionExpired;
push.OnNotificationFailed += push_OnNotificationFailed;
push.OnNotificationRequeue += push_OnNotificationRequeue;
push.OnNotificationSent += push_OnNotificationSent;
push.OnServiceException += push_OnServiceException;
push.RegisterWindowsService(new WindowsPushChannelSettings("NotificationFra",
"ms-app://s-1-15-2-", "bJl6kdPqXWtOclINfKNC"));
//Fluent construction of a Windows Toast Notification
push.QueueNotification(new WindowsToastNotification().WithLaunch("{\"message\":\"Hi PushNotification\",\"messageToken\":\"AbCD1A3@\",\"notificationType\":3}")
.AsToastText01("Notification Test for Daily alerts intrade FTD MTD ")
.ForChannelUri("https://hk2.notify.windows.com/?token=AwYAAAA%2b21ScKkaVZhp5vwRRPn7DWlEqvzKmTXy%2bNfcONUzq9PeglhxTLlD06%2fiLcgyuu9BbdeuY8Pgl"));
push.StopAllServices(waitForQueuesToFinish: true);
【问题讨论】:
-
有人知道吗?
-
任何人都可以使用上面的代码并重现问题。如果有人可以解决此问题,请帮助我
标签: c# windows-phone-8 pushsharp