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());
});
此登记工作正常时,我可以在蔚蓝在调试发送测试通知。
我做错了什么?
除此之外,如何在函数中添加一些标签来发送通知?