Windows 中的推送通知 phone 7.1 抛出错误 PushSharp.WindowsPhone.WindowsPhoneNotificationSendFailureException
Push notification in Windows phone 7.1 throwing error PushSharp.WindowsPhone.WindowsPhoneNotificationSendFailureException
我正在尝试在我的 windows phone 7.1 中发送推送通知,但抛出错误:
PushSharp.WindowsPhone.WindowsPhoneNotificationSendFailureException
服务器端编写的中间件代码如下:
var push = new PushBroker();
push.OnNotificationSent += NotificationSent;
push.OnChannelException += ChannelException;
push.OnServiceException += ServiceException;
push.OnNotificationFailed += NotificationFailed;
push.OnDeviceSubscriptionExpired += DeviceSubscriptionExpired;
push.OnDeviceSubscriptionChanged += DeviceSubscriptionChanged;
push.OnChannelCreated += ChannelCreated;
push.OnChannelDestroyed += ChannelDestroyed;
// WINDOWS PHONE NOTIFICATIONS
push.RegisterWindowsPhoneService();
push.QueueNotification(new WindowsPhoneToastNotification()
.ForEndpointUri(new Uri(url))
.ForOSVersion(WindowsPhoneDeviceOSVersion.Seven)
.WithBatchingInterval(BatchingInterval.Immediate)
// .WithNavigatePath("/MainPage.xaml")
.WithText1("Notification")
.WithText2("This is a push notification"));
push.StopAllServices(waitForQueuesToFinish: true);
Push sharp 处理程序方法是:
//this even raised when a notification is successfully sent
static void NotificationSent(object sender, INotification notification)
{
Debug.WriteLine("Sent: " + sender + " -> " + notification);
}
//this is raised when a notification is failed due to some reason
static void NotificationFailed(object sender, INotification notification, Exception notificationFailureException)
{
Debug.WriteLine("Failure: " + sender + " -> " + notificationFailureException.Message + " -> " + notification);
}
从使用 VS 2010 的前端 windows phone 框架我发送 URL 类似这样的自动生成的东西:
Notification channel URI:http://db3.notify.live.net/throttledthirdparty/01.00/AQE9Hz23hR07RYiaH7O3SeEkAgAAAAADAQAAAAQUZm52OjIzOEQ2NDJDRkI5MEVHHSNLL8wMQ
但不幸的是,我收到以下异常:
Failure: PushSharp.WindowsPhone.WindowsPhonePushService -> Exception of type 'PushSharp.WindowsPhone.WindowsPhoneNotificationSendFailureException' was thrown. -> <wp:Notification xmlns:wp="WPNotification">
帮帮我。提前致谢。
当我尝试使用 Device
时,相同的代码有效
不是模拟器。可能是因为虚拟 凭据 而发生错误。
我正在尝试在我的 windows phone 7.1 中发送推送通知,但抛出错误:
PushSharp.WindowsPhone.WindowsPhoneNotificationSendFailureException
服务器端编写的中间件代码如下:
var push = new PushBroker();
push.OnNotificationSent += NotificationSent;
push.OnChannelException += ChannelException;
push.OnServiceException += ServiceException;
push.OnNotificationFailed += NotificationFailed;
push.OnDeviceSubscriptionExpired += DeviceSubscriptionExpired;
push.OnDeviceSubscriptionChanged += DeviceSubscriptionChanged;
push.OnChannelCreated += ChannelCreated;
push.OnChannelDestroyed += ChannelDestroyed;
// WINDOWS PHONE NOTIFICATIONS
push.RegisterWindowsPhoneService();
push.QueueNotification(new WindowsPhoneToastNotification()
.ForEndpointUri(new Uri(url))
.ForOSVersion(WindowsPhoneDeviceOSVersion.Seven)
.WithBatchingInterval(BatchingInterval.Immediate)
// .WithNavigatePath("/MainPage.xaml")
.WithText1("Notification")
.WithText2("This is a push notification"));
push.StopAllServices(waitForQueuesToFinish: true);
Push sharp 处理程序方法是:
//this even raised when a notification is successfully sent
static void NotificationSent(object sender, INotification notification)
{
Debug.WriteLine("Sent: " + sender + " -> " + notification);
}
//this is raised when a notification is failed due to some reason
static void NotificationFailed(object sender, INotification notification, Exception notificationFailureException)
{
Debug.WriteLine("Failure: " + sender + " -> " + notificationFailureException.Message + " -> " + notification);
}
从使用 VS 2010 的前端 windows phone 框架我发送 URL 类似这样的自动生成的东西:
Notification channel URI:http://db3.notify.live.net/throttledthirdparty/01.00/AQE9Hz23hR07RYiaH7O3SeEkAgAAAAADAQAAAAQUZm52OjIzOEQ2NDJDRkI5MEVHHSNLL8wMQ
但不幸的是,我收到以下异常:
Failure: PushSharp.WindowsPhone.WindowsPhonePushService -> Exception of type 'PushSharp.WindowsPhone.WindowsPhoneNotificationSendFailureException' was thrown. -> <wp:Notification xmlns:wp="WPNotification">
帮帮我。提前致谢。
当我尝试使用 Device
时,相同的代码有效不是模拟器。可能是因为虚拟 凭据 而发生错误。