簡體   English   中英

急切推送-已達到最大發送嘗試次數

[英]Push sharp - The maximum number of Send attempts was reached

我收到此異常:

已達到發送嘗試發送通知的最大數量!

(僅用於Apple通知)每天多次,並在一段時間內一直阻止通知,然后繼續工作。 我不確定發生了什么。 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);
    }

我感謝您的幫助。

我使用了此版本“ PushSharp 2.1.2-beta”,並且不再遇到此異常。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM