我在推送通知服务器中使用PushSharp 4.0.10。
我可以向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应用程序开发“和”应用程序商店和Ad Hoc“。在这两种情况下,我都得到相同的错误。
有没有正确的生成证书的方法?
你能告诉我正确的方法吗,或者有没有其他的bug或者缺少更新?
谢谢你,占用你的时间。
发布于 2017-07-05 08:51:47
该错误消息是在创建ApnsConfiguration对象时生成的(参见源代码:https://github.com/Redth/PushSharp/blob/master/PushSharp.Apple/ApnsConfiguration.cs)。
如果您检查这个异常是如何引发的,您会注意到它是基于证书的名称的。在创建ApnsConfiguration对象时,可以通过为validateIsApnsCertificate参数传入false来删除检查。
这可能不能完全解决您的问题(如果证书有其他问题),但如果问题仅仅是证书的名称,那么这可能会有所帮助。
https://stackoverflow.com/questions/44842024
复制相似问题