Chazbot
Chazbot

Reputation: 1890

Provisioning Profiles + Push Notifications + Production vs Development

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:

Upvotes: 12

Views: 15643

Answers (2)

viggio24
viggio24

Reputation: 12366

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.

Upvotes: 14

alex_c
alex_c

Reputation: 2046

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.

Upvotes: 31

Related Questions