Until now I used development push certificate and the push notifications worked great.
Now I want to submit my app to Apple so I created a production certificate and set it under "code signing identity" -> "Release"
I also placed the .p12 file in my production server.
But the push now does not work.
Is it suppose to work when I run from xcode? or will it just work when downloading the app from App Store? If so how can I test it?
The production push will work when you download the app from the App Store.
UPDATE:
You can also test the production push with an AdHoc build of the app; see Trinca's answer.
UPDATE:
Now, the easiest solution is to use Apple's TestFlight. (In TestFlight, it is easy to add new remote users, sending them an email invitation, they then download on whatever device they choose.)
You can test APNS production environment building an AdHoc version of your App. The app will be using the production certificates and servers and it's purpose is exactly to test BEFORE you send it to AppleStore.
Take a looke at this link: what kind of certificate do I need to test apns using ad-hoc distribution?
Create an Adhoc distribution profile for your app in provisioning profile. Download profile and install. Choose the Adhoc dist profile to code sign your app. Archive ipa and save for adhoc distribution. Copy ipa to your device and test push. It will use production push certs as opposed to development cert. Hope this helps.
If you want to test Push Notification on production environment, you need to take care of few things:-
- Production push notifications can only be tested on ipa. You need to create ipa from AdHoc Distribution profile.
- You need to replace the Push certificate on your Push API server. APNS Distribution certificate is to be used in this case.
- If your API is in DOTNET then you need to change the boolean value to true.
- Change Code Signing Identity to distribution on both Projects and Targets
Testing production notifications (without releasing the build) is possible when the app is installed via Apple TestFlight.
This way the production notifications will be delivered to the app.
(If the exactly same build is installed via HockeyApp or by other means, the production notifications won't be delivered.)
Just set the build to internal testing after the build has finished processing in iTunes Connect.