1
我遇到同样的问题。我不是一名IOS开发人员,但我是一名c#开发人员。 iOS开发人员向我提供配置文件,以便在运行的Windows服务中发送推送通知。我用我的iPad测试了PushSharp,但没有奏效。我收到错误消息:发送IOS推送通知的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"));