apns-php sending push notifications using production profile

最后都变了- 提交于 2019-12-06 14:52:51

Somewhere I've read that both the SSL certificates could be put into a single PEM file. Unfortunately that hint didn't seem to be correct...

I found that having both the production and the sandbox SSL certificate in a single PEM file causes the production environment to silently fail.

Solution is to split the PEM into two separate files and pass it to the server accordingly:

$server=new ApnsPHP_Push_Server(ApnsPHP_Abstract::ENVIRONMENT_SANDBOX, 'server_certificates_bundle_sandbox.pem');

or

$server=new ApnsPHP_Push_Server(ApnsPHP_Abstract::ENVIRONMENT_PRODUCTION, 'server_certificates_bundle_production.pem');

After that, everything worked fine.

please also check whether your App Id enabled push notification

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