Я использую PushSharp 4.0.10
В событии OnNotificationFailed посредника Apns я получаю исключение «Запрошенная функция не поддерживается». Вот мой брокер создатель
private static ApnsServiceBroker CreateApnsBroker(string certificate)
{
// Configuration (NOTE: .pfx can also be used here)
var config = newApnsConfiguration(
ApnsConfiguration.ApnsServerEnvironment.Sandbox,
certificate,
ConfigurationManager.AppSettings["Cert_Passwd"],
false);
// Create a new broker
var apnsBroker = new ApnsServiceBroker(config);
// Wire up events
apnsBroker.OnNotificationFailed += (notification, aggregateEx) =>
{
aggregateEx.Handle(ex =>
{
// See what kind of exception it was to further diagnose
if (ex is ApnsNotificationException notificationException)
{
// Deal with the failed notification
var apnsNotification = notificationException.Notification;
var statusCode = notificationException.ErrorStatusCode;
Logger.Info($"Apple Notification Failed:
ID={apnsNotification.Identifier},
Code={statusCode}",
ex);
}
else
{
// Inner exception might hold more useful information
// like an ApnsConnectionException
Logger.Info($"Apple Notification Failed for some unknown reason:
{ex.InnerException}",
ex);
}
// Mark it as handled
return true;
});
};
apnsBroker.OnNotificationSucceeded += (notification) =>
{
Logger.Info($"Apple Notification Sent for device {notification.DeviceToken}");
};
return apnsBroker;
}
Отправить уведомление
private static void QueueNotification(
ApnsServiceBroker apnsBroker,
string deviceToken,
string payload)
{
// Queue a notification to send
apnsBroker.QueueNotification(new ApnsNotification
{
DeviceToken = deviceToken,
Payload = JObject.Parse(payload),
Expiration = DateTime.Now.AddDays(2)
});
}
Когда я останавливаю посредника в исключении OnNotificationFailed catch. В PushSharp и в моем коде я использовал ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12
Используя сертификат .p12 для VoIP уведомлений, он добавлен в mmc
В чем моя ошибка?