PushSharp 3.0 Info: https://github.com/Redth/PushSharp/tree/3.0-dev#pushsharp-v30---the-push-awakens
PushSharp.Google.GcmServiceConnection.Send() Line 58
where var response = await http.PostAsync (Configuration.GcmUrl, content);
System.Net.WebException: Error writing request: The authentication or decryption has failed.
apnsBroker.OnNotificationFailed += (notification, aggregateEx) =>
{
aggregateEx.Handle(ex =>
{
var exception = ex as ApnsNotificationException;
if (exception != null)
{
var notificationException = exception;
var apnsNotification = notificationException.Notification;
var statusCode = notificationException.ErrorStatusCode;
LogManager.LogManager.Instance.Log(LogLevel.Error, exception.Message);
}
else
{
LogManager.LogManager.Instance.Log(LogLevel.Error, ex.Message);
}
return true;
});
};
apnsBroker.OnNotificationSucceeded += (notification) =>
{
LogManager.LogManager.Instance.Log(LogLevel.Error, "Notification Sent");
};
apnsBroker.Start();
foreach (var deviceToken in entity.DeviceTokens)
{
apnsBroker.QueueNotification(new ApnsNotification
{
DeviceToken = deviceToken,
Payload = JObject.Parse("{\"aps\":{\"badge\":1,\"sound\":\"sound.caf\",\"alert\":\"" + entity.Body + "\"}}")
});
}
apnsBroker.Stop();
}
catch (Exception e)
{
LogManager.LogManager.Instance.Log(LogLevel.Error, e.Message);
}
apnsBroker.OnNotificationFailed += (notification, aggregateEx) =>
{
aggregateEx.Handle(ex =>
{
var exception = ex as ApnsNotificationException;
if (exception != null)
{
var notificationException = exception;
var apnsNotification = notificationException.Notification;
var statusCode = notificationException.ErrorStatusCode;
LogManager.LogManager.Instance.Log(LogLevel.Error, exception.Message);
}
else
{
LogManager.LogManager.Instance.Log(LogLevel.Error, ex.Message);
}
return true;
});
};
apnsBroker.OnNotificationSucceeded += (notification) =>
{
LogManager.LogManager.Instance.Log(LogLevel.Error, "Notification Sent");
};
apnsBroker.Start();
foreach (var deviceToken in entity.DeviceTokens)
{
apnsBroker.QueueNotification(new ApnsNotification
{
DeviceToken = deviceToken,
Payload = JObject.Parse("{\"aps\":{\"badge\":1,\"sound\":\"sound.caf\",\"alert\":\"" + entity.Body + "\"}}")
});
}
apnsBroker.Stop();
}
catch (Exception e)
{
LogManager.LogManager.Instance.Log(LogLevel.Error, e.Message);
}
}