1

apns-php を使用してプッシュ通知サービスを実装していますが、最近この問題に直面しています。

プッシュ通知は開発プロファイルで機能し、本番環境では機能しません。

Apple サーバーからエラーは発生せず、問題なく動作していることがわかります。ここにログがあります

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では通知が届きませんでした。

たぶん、誰かが以前にこの問題に直面しましたか?どんな助けでも大歓迎です。

ありがとう!

4

2 に答える 2

1

どこかで、両方の SSL 証明書を 1 つの PEM ファイルに入れることができると読んだことがあります。残念ながら、そのヒントは正しくないようでした...

実稼働環境とサンドボックス SSL 証明書の両方が 1 つの PEM ファイルに含まれていると、実稼働環境がサイレントに失敗することがわかりました。

解決策は、PEM を 2 つの個別のファイルに分割し、それに応じてサーバーに渡すことです。

$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');

その後、すべてがうまくいきました。

于 2012-07-24T02:13:53.760 に答える