apns-php使用生产配置文件发送推送通知

我们使用apns-php来实现推送通知服务,并且最近遇到了这个问题:

推送通知适用于我们的开发配置文件,不适用于生产。

我们没有从苹果服务器得到错误,我们可以看到他们工作正常。 这是日志

2012/05/09 07:26:50 [trace] [push_notification] APNS: INFO: Trying ssl://gateway.push.apple.com:2195... 2012/05/09 07:26:51 [trace] [push_notification] APNS: INFO: Connected to ssl://gateway.push.apple.com:2195. 2012/05/09 07:26:51 [trace] [push_notification] APNS: Added recipient iPad with YSA_ID:209 2012/05/09 07:26:51 [trace] [push_notification] APNS: Added recipient iPad with YSA_ID:323 2012/05/09 07:26:51 [trace] [push_notification] APNS: Added recipient iPad with YSA_ID:326 2012/05/09 07:26:51 [trace] [push_notification] APNS: INFO: Sending messages queue, run #1: 3 message(s) left in queue. 2012/05/09 07:26:51 [trace] [push_notification] APNS: STATUS: Sending message ID 1 [custom identifier: YSA-Notification-ID#181] (1/3): 121 bytes. 2012/05/09 07:26:51 [trace] [push_notification] APNS: STATUS: Sending message ID 2 [custom identifier: YSA-Notification-ID#181] (1/3): 121 bytes. 2012/05/09 07:26:51 [trace] [push_notification] APNS: STATUS: Sending message ID 3 [custom identifier: YSA-Notification-ID#181] (1/3): 121 bytes. 2012/05/09 07:26:52 [trace] [push_notification] APNS: INFO: Disconnected. 

所以你可以看到没有错误。 但iPad上没有收到任何通知。

也许有人之前遇到过这个问题? 任何帮助将受到高度赞赏。

谢谢!

在某处我读过SSL证书都可以放入一个PEM文件中。 不幸的是,提示似乎不正确……

我发现在单个PEM文件中同时拥有生产和沙盒SSL证书会导致生产环境无声地失败。

解决方案是将PEM拆分为两个单独的文件,并相应地将其传递给服务器:

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

要么

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

在那之后,一切都很好。

另请检查您的App Id是否启用了推送通知