I am successfully using APN with my app in developer mode, but I cannot get it to work in adhoc distribution mode.
i've followed faithfully the tutorial http://www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part-12 and I've read all the other posts on this issue that i could find on SO and elsewhere.
in developer mode I create the cer and p12 pem files and combine them: when i try: openssl s_client -connect gateway.push.apple.com:2195 -cert aps_production.cer.pem -key MyPrivateKey.p12.pem, I get:
depth=1 /C=US/O=Entrust, Inc./OU=www.entrust.net/rpa is incorporated by reference/OU=(c) 2009 Entrust, Inc./CN=Entrust Certification Authority - L1C
verify error:num=20:unable to get local issuer certificate
verify return:0
-----BEGIN CERTIFICATE-----
(certificate deleted)
-----END CERTIFICATE-----
subject=/C=US/ST=California/L=Cupertino/O=Apple Inc./OU=iTMS Engineering/CN=gateway.push.apple.com
issuer=/C=US/O=Entrust, Inc./OU=www.entrust.net/rpa is incorporated by reference/OU=(c) 2009 Entrust, Inc./CN=Entrust Certification Authority - L1C
---
No client certificate CA names sent
---
SSL handshake has read 2723 bytes and written 2140 bytes
---
New, TLSv1/SSLv3, Cipher is AES256-SHA
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
SSL-Session:
Protocol : TLSv1
Cipher : AES256-SHA
Session-ID:
Session-ID-ctx:
Master-Key: (deleted)
Key-Arg : None
Start Time: 1348332242
Timeout : 300 (sec)
Verify return code: 0 (ok)
I don't know what the "verify error:num=20:unable to get local issuer certificate" means or if it is important. I get the very same thing when I use gateway.sandbox.push.apple.com:2195 with my developer cer and key, but it works fine.
when i then use simplepush.php with a developer version of app on phone. notifications work perfectly. when i use the same with adhoc distribution, and a adhoc distribution version of app on phone, i get nothing despite simplepush.php returning: "Delivered Message to APNS"
i've queried the feedback service, and there are no errors reported.
Others have suggested that APNS doesn't work for adhoc mode if the app hasn't been approved by apple. Is that the problem? Our app is still under review.
Thanks for your help.