【问题标题】:Push notification in Windows phone 7.1 throwing error PushSharp.WindowsPhone.WindowsPhoneNotificationSendFailureExceptionWindows phone 7.1 中的推送通知引发错误 PushSharp.WindowsPhone.WindowsPhoneNotificationSendFailureException
【发布时间】:2015-07-17 07:32:19
【问题描述】:

我正在尝试在我的 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 尖锐处理程序方法是:

    //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 for 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">

帮帮我。提前致谢。

【问题讨论】:

    标签: asp.net-mvc windows windows-7 push-notification pushsharp


    【解决方案1】:

    当我尝试使用 设备

    时,相同的代码有效

    不是模拟器。可能是由于虚拟凭据而发生错误。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多