Reputation: 9378
I am having the same issue. I am not a IOS developer, but I am a c# developer. The iOS developer gave me the provision file to send out Push notification in our running windows service. I tested out PushSharp with just my iPad and it did not work. I received the error message:
Push Notification Fail: PushSharp.Core.MaxSendAttemptsReachedException: The maximum number of Send attempts to send the notification was reached!
I have tried this locally and on a server, and I am only trying to send 1 push.
Code.
var appleCertificate =
File.ReadAllBytes(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "sb_push.p12"));
var push = new PushBroker();
/* push.OnNotificationSent += NotificationSent;
push.OnChannelException += ChannelException;
push.OnServiceException += ServiceException;
push.OnNotificationFailed += NotificationFailed;
push.OnDeviceSubscriptionExpired += DeviceSubscriptionExpired;
push.OnDeviceSubscriptionChanged += DeviceSubscriptionChanged;
push.OnChannelCreated += ChannelCreated;
push.OnChannelDestroyed += ChannelDestroyed;
push.OnNotificationSent += NotificationSent;*/
push.OnNotificationFailed += NotificationFailed;
push.RegisterAppleService(new ApplePushChannelSettings(appleCertificate, "PASSWORD!"));
push.QueueNotification(new AppleNotification()
.ForDeviceToken(deviceToken)
.WithAlert(message)
.WithSound("default"));
Upvotes: 1
Views: 3900
Reputation: 120
I am also using windows server and I was able to resolved this issue. See "PushSharp ApplePushService giving a Channel Exception" and "Processing multiple Notifications with PushSharp for ios and android". Both got resolved by regenerating my certificate.
Upvotes: 1