0
我試圖找出通過天藍色的移動服務中的通知中心向Windows Phone用戶發送推送通知的方式。我嘗試了幾種這樣的方式。但沒有發送消息。在天藍色的移動服務中通過通知中心發送推送通知
hub.mpns.sendToast("PushChannel", template, sendComplete);
登記服務WP我做過這樣的:
var channel = HttpNotificationChannel.Find("cQuestPushChannel");
if (channel == null){
channel = new HttpNotificationChannel("cQuestPushChannel");
channel.Open();
channel.BindToShellToast();
}
string[] tagsToSubscribeTo = { "xxx" };
channel.ChannelUriUpdated += new EventHandler<NotificationChannelUriEventArgs>(async (o, args) =>
{
var hub = new NotificationHub("***", "***");
await hub.RegisterNativeAsync(args.ChannelUri.ToString());
});
此登記工作正常時,我可以在蔚藍在調試發送測試通知。
我做錯了什麼?
除此之外,如何在函數中添加一些標籤來發送通知?