【问题标题】:Send Push Notification to iOS PushSharp certificate向 iOS PushSharp 证书发送推送通知
【发布时间】:2017-06-30 08:29:38
【问题描述】:

我在推送通知服务器中使用 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.

我已经创建了一个证书“Apple Push Notification service SSL (Sandbox & Production)”以及个人证书“iOS App Development”和“App Store and Ad Hoc”。在这两种情况下,我都会遇到相同的错误。

有没有正确的生成证书的方法?

您能否指出正确的方法,或者是否有任何其他错误或缺少更新?

感谢您的宝贵时间。

【问题讨论】:

    标签: ios ionic-framework push-notification certificate pushsharp


    【解决方案1】:

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

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-01-10
      • 1970-01-01
      • 2016-05-26
      • 1970-01-01
      • 2011-12-25
      相关资源
      最近更新 更多