0
我得到這個異常:銳推 - 發送嘗試的最大數量達到
達到發送嘗試發送通知的最大數量!
(僅適用於蘋果通知)每天多次,並保持阻止通知一段時間,然後繼續工作。我不確定發生了什麼事。 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);
}
我感謝你的幫助。
即使在最新版本2.1.2 beta – sarat