APNS Certificate Issue while sending notification to iOS App

笑着哭i 提交于 2019-12-24 14:08:55

问题


To send notifications to my adhoc app i selected previously Distribution APNS service. I got notifications successfully.

But now while creating certificate I’m in confusion which one to select in portal..

Selected (sandbox&Prodcution) and created .p12 file and uploaded to my sever.. But Im getting following error You have selected the Production server, yet your Certificate does not appear to be the Production certificate! Please check to ensure you have the correct certificate!

I figured out the Issue is due to PushSharp,

https://github.com/Redth/PushSharp/issues/585#issue

But unable to edit/Modify that code in that class.

Please help me

Thank you...


回答1:


For Development Notification: Select - "Apple Push Notification service SSL(SandBox)"

For Production/Distribution Notification: Select - "Apple Push Notification service SSL(SandBox & Production)"




回答2:


After Changing to following code in my server side

pushBroker.RegisterAppleService(new ApplePushChannelSettings(true, appleCertificate, password));

to

pushBroker.RegisterAppleService(new ApplePushChannelSettings(true, appleCertificate, password, true));

Changes: Added One more parameter to constructor to disable certificate check.

Now Im getting notifications for old/new certificates..

Thanks..



来源:https://stackoverflow.com/questions/34390486/apns-certificate-issue-while-sending-notification-to-ios-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!