Getting started with iOS Push NotificationsUpdated Sept. 11, 2012
This guide will show you how to configure an iOS app to receive push notifications. If your app is already set up to receive push notifications, follow the Mixpanel iOS push guide to learn how to use Mixpanel to send your notifications.
Note that since the iOS simulator is not capable of receiving push notifications, you'll need an iOS device and an Apple Developer license to receive notifications.
Create an App ID
To send push notifications, you need create an App ID and push certificate. Head to the iOS Provisioning Portal to get started. Click "App IDs" in the left sidebar, then click the "New App ID" button. (Note: you can configure an existing app for push notifications as well.)
Create your App ID. Make sure you do not use the wildcard character "*" in the Bundle Identifier.
Find the App ID you just created in the list and click "Configure".
Check off "Enable for Apple Push Notification Service", then click "Configure" on the Development Push SSL Certificate line. Note: you will have to repeat this step for the Production Push SSL Certificate when you are sending your application to the App Store.
The Apple Push Notification service SSL Certificate Assistant will open. Follow its instructions to generate and download the Push Notification Certificate you need. If you can't locate Keychain Access in your Utilities directory, try using Spotlight to search for it.
Enter your Apple developer email address in the "User Email Address" and leave the "CA Email Address" field blank. Select "Saved to disk".
Click continue and save the certificate request file. Upload this file using the assistant on Apple's website.
Double click the downloaded certificate to install it in your keychain.
Provision your application
To get your application to run on a device, it needs to be provisioned. If you've already generated a provisioning profile, you will have to regenerate and reinstall it after enabling push notifications. Here, we will generate a new one.
From the iOS Provisioning Portal, click "Provisioning" in the left sidebar, then click the "New Profile" button.
Create your profile using the certificate and App ID you just generated.
Once the status of your new profile changes from "Pending" to "Active", click the "Download" button.
Double click the downloaded file to install the profile.
Configure your application for push notifications
Open or create a new project in Xcode. Then open the file called YourProjectName-Info.plist in the Supporting Files folder. Edit the "Bundle Identifier" to match the Bundle Identifier you set in your App ID.
Select your project in the left sidebar. Make sure the item under the "Project" heading is selected, not your target under the "Target" heading. Switch to the "Build Settings" tab and change all the values of "Code Signing Identity" to the provisioning profile you just installed. If you don't see "Code Signing Identity" in the list, make sure you've selected the "All" option, not "Basic".
You also need to change the "Code Signing Identity" under your project's target.
Now that your app is configured to receive push notifications, read the Mixpanel iOS Push guide to learn how to use Mixpanel to send your users push notifications.