Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/121.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 发送IOS推送通知时出现PushSharp错误消息_C#_Ios_Push Notification_Pushsharp - Fatal编程技术网

C# 发送IOS推送通知时出现PushSharp错误消息

C# 发送IOS推送通知时出现PushSharp错误消息,c#,ios,push-notification,pushsharp,C#,Ios,Push Notification,Pushsharp,我也有同样的问题。我不是IOS开发者,但我是c#开发者。iOS开发人员给了我一个配置文件,以便在我们正在运行的windows服务中发送推送通知。我用我的iPad测试了PushSharp,但它不起作用。我收到了错误消息: 推送通知失败:PushSharp.Core.MaxSendAttemptsReachedException:已达到发送通知的最大尝试次数 我已经在本地和服务器上尝试过,我只尝试发送一次推送 代码 我也在使用windows server,我能够解决这个问题。见“及”。通过重新生成我

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

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

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

代码


我也在使用windows server,我能够解决这个问题。见“及”。通过重新生成我的证书,两者都得到了解决

我也在使用windows server,我已经解决了这个问题。见“及”。通过重新生成我的证书,两者都得到了解决

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