2017-06-30 129 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來移除該檢查。

這可能無法完全解決您的問題(如果證書有其他問題),但如果它只是證書的名稱是問題,那麼這可能會有所幫助。