I have got a simple code:
PushBroker pushBroker = new PushBroker();
string path = HttpContext.Current.Server.MapPath("~/" + AppSettings.CertificatePath);
var appleCert = File.ReadAllBytes(path);
pushBroker.RegisterAppleService(
new ApplePushChannelSettings(AppSettings.IsProductionPushNotificationServer,
appleCert,
AppSettings.CertificatePassword));
var notification = new AppleNotification().ForDeviceToken(deviceToken.TrimStart('<').TrimEnd('>'))
.WithBadge(unviewedInvitationCount);
pushBroker.QueueNotification(notification);
I try to use development and production sertificates with Sandbox and Production server respectively. But nothing is happened. Client side is able to get the push notifications. What's wrong? Thanks in advance.
UPDATED:
I subscribed on the events.
OnNotificationFailed says me about this error:
{APNS NotificationFailureException -> 5 : Invalid token size -> {"aps":{"badge":1}}}
And if I wrap my device token into <...> I receive another error:
{APNS NotificationFailureException -> 8 : Invalid token -> {"aps":{"badge":1}}}