Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
775 views
in Technique[技术] by (71.8m points)

iphone - iOS Push Notifications not working for Distribution

I have tried the Push Notification for my application for development and it's working fine. When I am generating the .p12 file of production(distribution) it's getting created. After deployin .pem file on the server it's throwing and error.

OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=SSLv3 read server s ession ticket A: sslv3 alert certificate unknown):" }

Server : RoR(Ruby on Rails) Any help would be very appreciable.

Note : For the development .p12 it's working fine. The issue is when I'm deploying distribution .p12. Please suggest what may I be missing.

Thanks and Regards

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

check this in your sever code

gateway.push.apple.com, port 2195 for distribution

gateway.sandbox.push.apple.com, port 2195

  1. Log-in to the iPhone Developer Program Portal.
  2. Choose App IDs from the menu on the right.
  3. Create an App ID without a wildcard.
  4. Click the Configure link next to this App ID and then click on the button to start the wizard to generate a new Development Push SSL Certificate. for development (or) to generate a new Production Push SSL Certificate for distribution.
  5. Download this certificate and double click on aps_developer_identity.cer to import it into your Keychain
  6. Launch Keychain Assistant and click on My Certificates on the left Expand Apple Development Push Services and select Apple Development Push Services
  7. Right-click and choose "Export 1 elements..." and save as apns-cert.p12. AND your private key in the same expand area Right-click and choose "Export 1 elements..." and save as apns-key.p12.

8.Open Terminal and change directory to location used to save .p12 and convert the PKCS12 certificate bundle into PEM format using this command

i). openssl pkcs12 -clcerts -nokeys -out apns-cert.pem -in apns-cert.p12 ii). openssl pkcs12 -nocerts -out apns-key.pem -in apns-key.p12 here u have to give some key for access into the php code.

Remove passphrase

iii). openssl rsa -in apns-key.pem -out apns-key-noenc.pem here u have to give same key for Remove passphrase.

finally iv). cat apns-cert.pem apns-key-noenc.pem > apns-dev.pem.

Now you can use this PEM file as your certificate in ApnsPHP!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...