0

In my app I am using Apple push notifications. I followed Raywenderlich development tutorial. I am able to send and receive push notifications, but this is for development only. Now i want to submit my app at app store. I need an easy tutorial like the above for (APNS)distribution. Please help me. Thanks. I am using ios7 and xcode 5.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
user3587946
  • 83
  • 10
  • 1
    Here is the link that will surely help you. http://stackoverflow.com/questions/21250510/generate-pem-file-used-to-setup-apple-push-notification/21253261#21253261 – Ravi_Parmar May 17 '14 at 11:01
  • already u have the SSL distribution certificate, if yes i tell the some simple stepsm otherwise create the SSL distribution certificate in developer site – Anbu.Karthik May 17 '14 at 11:15

2 Answers2

0

Find for following lines in simplepush.php

ssl://gateway.sandbox.push.apple.com:2195

and replace it with following

ssl://gateway.push.apple.com:2195

Make sure you have generated the certificate and key for production as well

iDeveloper
  • 498
  • 4
  • 9
0

You must also change the certificate that is used for the APNS connection when you change the url.

What I do in my apps is allow for connections to either server (sandbox or production). In my server that sends APNS to Apple, I check to see if the notification is a development or a production request, and direct it to the appropriate url, using the right certificate.

I have an extra column in my table that I use to store APNS subscriptions to indicate whether this is a development subscription and should use the development (sandbox) certificate.

id, 
DeviceToken, 
DeviceID --identifierForVendor, 
NetworkID, 
Application, 
AddedOn, 
Active, 
Dev, 
BadgeCount

Then you can just do the logic in your APNS server app and decide which URL and which cert to use.

Like iDeveloper said, ssl://gateway.sandbox.push.apple.com:2195 or sl://gateway.push.apple.com:2195

LJ Wilson
  • 14,445
  • 5
  • 38
  • 62