2017-06-30 128 views
0

我在推送通知服务器中使用PushSharp 4.0.10。向iOS PushSharp证书发送推送通知

我可以发送推送通知到Android,但是当我试图推送通知给iOS,出现错误:

Something went wrong in Comunications Worker: 
Method name -> PushNotifications.DispatchPushNotifications() 
Message -> There is an error sending iOS push notifications. 
Exception - > Specified argument was out of the range of valid values. 
Parameter name: You are using a certificate created for connecting only to the Sandbox APNS server but have selected a different server environment to connect to. 

我已经创建了一个证书“苹果推送通知服务SSL(沙盒&制作)“以及个人证书”iOS App Development“和”App Store和Ad Hoc“。在这两种情况下,我都得到相同的错误。

是否有任何正确的方法来生成证书?

你能指点我正确的方法,还是有任何其他错误或缺少更新?

谢谢你,为你的时间。

回答

0

创建ApnsConfiguration对象时会生成该错误消息(请参阅源代码:https://github.com/Redth/PushSharp/blob/master/PushSharp.Apple/ApnsConfiguration.cs)。

如果您检查如何引发此特定异常,您会注意到它基于证书的名称。创建ApnsConfiguration对象时,您可以通过为validateIsApnsCertificate参数传递false来移除该检查。

这可能无法完全解决您的问题(如果证书有其他问题),但如果它只是证书的名称是问题,那么这可能会有所帮助。