この例外が発生しています:
通知を送信するための最大送信試行回数に達しました!
(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);
}
私はあなたの助けに感謝します。