2012-05-09 25 views
1

推送通知我們使用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上收到通知。

也許有人遇到過這個問題嗎?任何幫助將不勝感激。

謝謝!

回答

1

某處我讀過這兩個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'); 

在那之後,一切運行良好。

0

請同時檢查您的App ID是否啓用推送通知

相關問題