我们使用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上没有收到任何通知。
也许以前有人遇到过这个问题?任何帮助都将不胜感激。
谢谢!
发布于 2012-07-24 10:13:54
我在某处读到过,这两个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');在那之后,一切都运行得很好。
发布于 2014-03-13 15:10:47
请同时检查您的App Id是否启用了推送通知
https://stackoverflow.com/questions/10518688
复制相似问题