发送推送通知到iOS PushSharp证书 [英] Send Push Notification to iOS PushSharp certificate

查看:251
本文介绍了发送推送通知到iOS PushSharp证书的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在推送通知服务器中使用的是PushSharp 4.0.10.

I'm using PushSharp 4.0.10 in my push notification server.

我可以将推送通知发送到Android,但是当我尝试将推送通知发送到ios时,会发生错误:

I can send push notifications to Android, but when I'm trying to send push notifications to ios, an error occurs:

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(沙盒和生产)",还创建了个人证书"iOS App Development"和"App Store and Ad Hoc".在这两种情况下,我都会遇到相同的错误.

I already created a certificate "Apple Push Notification service SSL (Sandbox & Production)" and also the individuals certificates "iOS App Development" and "App Store and Ad Hoc". In both cases I get the same error.

有什么正确的方法来生成证书吗?

Is there any correct way to generate the certificate?

您能为我指出正确的方法吗,还是还有其他错误或缺少更新?

Can you point me the correct way, or is there any other bug or missing update?

谢谢您的时间.

推荐答案

该错误消息是在创建ApnsConfiguration对象时生成的(请参见源代码:

That error message is generated when creating an ApnsConfiguration object (see source code: https://github.com/Redth/PushSharp/blob/master/PushSharp.Apple/ApnsConfiguration.cs).

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

If you check how this particular exception is raised, you'll note it's based on the name of the certificate. You can remove the check by passing in false for the validateIsApnsCertificate argument when creating an ApnsConfiguration object.

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

This might not resolve your issue entirely (if there's something else wrong with the certificate) but if it's just the certificate's name that is the issue then this might help.

这篇关于发送推送通知到iOS PushSharp证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆