duanjing9739 2012-05-09 14:58
浏览 138
已采纳

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

We use apns-php to implement push notification service and have faced this problem recently:

Push notifications work with our Development Profile and not work for Production.

We get no errors from apple servers and we can see that they work fine. Here's the log

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.

So as you can see there are no errors. But no notifications received on the iPad.

Maybe somebody faced this problem before? Any help would be highly appreciated.

Thanks!

  • 写回答

2条回答 默认 最新

  • duansang8388 2012-07-24 02:13
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 使用C#,asp.net读取Excel文件并保存到Oracle数据库
  • ¥15 C# datagridview 单元格显示进度及值
  • ¥15 thinkphp6配合social login单点登录问题
  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配