Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 442
Akshay Avatar asked Mar 29 '12 07:03

Akshay


People also ask

How do I fix Apple push notifications?

You can fix an iPhone that's not getting notifications by restarting it or making sure notifications are turned on. You should also make sure your iPhone is connected to the internet so apps can receive notifications. If all else fails, you should try resetting the iPhone — just make sure to back it up first.

Why are my push notifications not working?

Do Not Disturb or Airplane Mode is on. Either system or app notifications are disabled. Power or data settings are preventing apps from retrieving notification alerts. Outdated apps or OS software can cause apps to freeze or crash and not deliver notifications.

Why don't I get push notifications on my iPhone?

Go to Settings > Notifications, select the app, and make sure that Allow Notifications is on. If you have notifications turned on for an app but you're not receiving alerts, you might not have Banners selected. Go to Settings > Notifications, select the app, then select Banners.

Does Apple block push notifications?

iOS enables you to both disable push notifications entirely, or turn them off for individual apps. To access iOS notifications settings, go into the Settings > Notifications menu. From that list, you can configure each app's notifications settings or disable them.


1 Answers

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!

like image 151
Senthilkumar Avatar answered Nov 08 '22 02:11

Senthilkumar