1

我有同样的问题。我不是 IOS 开发人员,但我是 ac# 开发人员。iOS 开发人员给了我配置文件,以便在我们正在运行的 Windows 服务中发送推送通知。我只用我的 iPad 测试了 PushSharp,但它不起作用。我收到错误消息:

推送通知失败:PushSharp.Core.MaxSendAttemptsReachedException:已达到发送通知的最大发送尝试次数!

我已经在本地和服务器上尝试过,我只是想发送 1 次推送。

代码。

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"));
4

1 回答 1

1

我也在使用 Windows 服务器,我能够解决这个问题。请参阅“ PushSharp ApplePushService 给出通道异常”和“使用 PushSharp for ios 和 android 处理多个通知”。通过重新生成我的证书,两者都得到了解决。

于 2013-08-07T15:19:22.427 回答