12

I'm building an iOS app that uses push notifications, and I'm finally ready to submit it. Before I do, I'd like to test out push notifications off the Production server, to make sure everything is working correctly. Thus far, the sandbox environment has been working fine.

After doing quite a bit of searching, I learned that switching the servers over from ssl://gateway.sandbox.push.apple.com:2195 to ssl://gateway.push.apple.com:2195 wasn't enough, and that production push tokens are different from sandbox push tokens. Instead, apparently I need a new provisioning profile with Production entitlements, new certs installed on my server, and to re-build my app with said profile so that it knows to create the correct push tokens.

So, after going through all the steps, I can't even make a build run on my phone; XCode says

This profile cannot be installed on devices

Here are the steps I've taken. If I'm missing something please let me know:

  • In my iOS Developer Center, I've made sure that my AppID is "enabled for production" under the Apple Push Notification Service.

  • Also in my iOS Developer Center, I've created my Production Push SSL Certificate, gone through the necessary conversion steps, and installed the resulting .pem on my server.

  • Per the instructions, I've create "a new provisioning profile containing the App ID you wish to use for notifications." I've done this by going to Provisioning, and clicking on the "Distribution" tab, and making a new profile. I've confirmed that "production" is set under the "entitlements" section of this profile.

  • I've selected the provisioning profile in my project settings. I get the message

    This profile cannot be installed on devices

    and I'm stuck.

1
  • 1
    With the addition of Apples Testflight you can now test Production Push Notifications before going live. You simply upload a build and change your certificate to production.(also point to Apples live push not sandbox)
    – AMAN77
    Commented Nov 6, 2014 at 4:41

2 Answers 2

31

Build an ad-hoc distribution version of your app, and install it on your own device. That will use the production APN gateway and certs.

0
14

You cannot install an app compiled with a appstore distribution (production) profile on a device. Only Apple reviewers can do that. you can only test push on an app compiled in development mode and using sandbox server. If you want to test production servers, you must compile the app using an AdHoc distribution profile enabling the devices you want to do the test. Clearly you must recompile and the send the app for review using the App Store distribution profile.

5
  • I found I could install an app built in Xcode with the App Store distribution profile (under the Debug profile). However, the debugger would not attach (which is expected for an App Store build). That said, I was able to just launch the app on the iPad and test the production push notification setup that way.
    – penfold
    Commented Dec 4, 2012 at 1:12
  • This sounds strange to me. It is true that you can do this with an AdHoc distribution profile, but it sounds strange to me you can do the same with an App Store profile. Are you using a Jailbroken device?
    – viggio24
    Commented Dec 4, 2012 at 10:36
  • No, not jailbroken, although it's possible I got confused as is easy to do. :-) Reading my comment again now, it does seem unlikely that you could run an app that doesn't have the UDID in the profile... perhaps it was still built with an Ad Hoc profile and still received push notifications from the production service?
    – penfold
    Commented Jan 8, 2013 at 22:33
  • are you 100% sure that we cannot test push notification on production servers? i have another iphone which is in another city, i want to test push notification with that device , how could i do that? please tell me.
    – Nitin
    Commented May 27, 2015 at 12:01
  • Update: In case anyone finds this old answer, the solution today is Apple's TestFlight. Commented Feb 14, 2017 at 22:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.