虽然我一直在尝试使用以下代码在我的 Windows Phone 解决方案上使用基本的通知中心教程
var channel = HttpNotificationChannel.Find("MyPushChannel3");
if (channel == null)
{
channel = new HttpNotificationChannel("MyPushChannel3");
channel.Open();
channel.BindToShellToast();
}
channel.ChannelUriUpdated += new EventHandler<NotificationChannelUriEventArgs>(async (o, args) =>
{
var hub = new NotificationHub("http://messaging-ns.servicebus.windows.net/messagingt", "---MY CONECTION STRING---");
await hub.RegisterNativeAsync(args.ChannelUri.ToString());
});
我在 await 行中收到 NotificationHubNotFoundException 并带有以下消息
HTTP 请求失败。
HTTP 详细信息:状态:404 原因:未找到完整内容:
404
指定地址没有托管服务..TrackingId:2e4b1100-18de-4b24-bbec-68516ddc3b60_G4,TimeStamp:2/2/2014 1:30:23 AM
我为 NotificationHub 构造函数的第一个参数尝试了许多选项,称为“notificationHubPath”,但没有成功注册我的应用程序。过去任何人都遇到过这个错误。不幸的是,没有足够的文档说明这个构造函数在 MDSN 中是如何工作的。
谢谢