【问题标题】:apns-php sending push notifications using production profileapns-php 使用生产配置文件发送推送通知
【发布时间】:2012-05-18 02:55:17
【问题描述】:

我们使用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 上没有收到任何通知。

也许以前有人遇到过这个问题?任何帮助将不胜感激。

谢谢!

【问题讨论】:

    标签: php ios notifications push


    【解决方案1】:

    请同时检查您的 App Id 是否启用推送通知

    【讨论】:

      【解决方案2】:

      我在某处读到,两个 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');
      

      之后,一切正常。

      【讨论】:

        猜你喜欢
        • 2013-06-10
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-05-08
        • 2013-01-11
        • 2015-12-29
        • 2011-06-07
        • 2017-11-10
        相关资源
        最近更新 更多