Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

  • 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.

like image 372
Chazbot Avatar asked Sep 22 '11 19:09

Chazbot


People also ask

Can developer create provisioning profile?

Only team agents and admins can create development provisioning profiles. This profile contains a name, a set of development certificates, a set of device IDs, and an app ID. A development provisioning profile ties developers and devices to a development team.

What is the difference between a push notification and a regular notification?

The main difference between push notification and notification is that the latter are created internally from an application on the device that wants to show user some information, a reminder, some news or updates, and so on.


2 Answers

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.

like image 148
alex_c Avatar answered Nov 15 '22 19:11

alex_c


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.

like image 34
viggio24 Avatar answered Nov 15 '22 17:11

viggio24