【问题标题】:Push sharp - The maximum number of Send attempts was reachedPush sharp - 已达到最大发送尝试次数
【发布时间】:2014-03-27 22:13:19
【问题描述】:

我遇到了这个异常:

已达到发送通知的最大发送尝试次数!

(仅适用于苹果通知)每天多次并一直阻止通知一段时间,然后它会继续工作。我不确定发生了什么。 ServiceException 事件正在捕获此异常。

我正在使用 pushsharp 默认配置。

这是我的代码:

     string result = null;
     try
     {
        push = new PushBroker();
        //Wire up the events
        push.OnNotificationSent += NotificationSent;
        push.OnChannelException += ChannelException;
        push.OnServiceException += ServiceException;
        push.OnNotificationFailed += NotificationFailed;
        push.OnDeviceSubscriptionExpired += DeviceSubscriptionExpired;
        push.OnDeviceSubscriptionChanged += DeviceSubscriptionChanged;
        push.OnChannelCreated += ChannelCreated;
        push.OnChannelDestroyed += ChannelDestroyed;

        var appleCert = File.ReadAllBytes(apnCert);

        push.RegisterAppleService(new ApplePushChannelSettings(
            apnProduction, appleCert, apnCertPassword));
        LogNotificationForDevice("", "Apple PN registered Successfully", "");

        push.RegisterGcmService(new GcmPushChannelSettings(androidCertToken));
        LogNotificationForDevice("", "Android PN registered Successfully", "");

        var res = new
        {
            status = "Success"
        };
        result = JsonConvert.SerializeObject(res, Formatting.Indented);
    }
    catch (Exception ex)
    {
        var resex = new
        {
            status = "Failure",
            Message = ex.Message
        };
        result = JsonConvert.SerializeObject(resex, Formatting.Indented);

        LogNotificationForDevice("", "Error when trying to initiate the PushBroker", result);
    }

感谢您的帮助。

【问题讨论】:

    标签: c# pushsharp


    【解决方案1】:

    我使用的是“PushSharp 2.1.2-beta”这个版本,但我不再遇到这个异常了。

    【讨论】:

    • 即使在最新的 2.1.2 测试版中,这对我来说仍然存在
    猜你喜欢
    • 1970-01-01
    • 2013-05-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多