To get started, you need an iOS app.
Use this section below to add your step-by-step tutorial instructions.
Go to Target sample in your XCode project, select the Capabilities tab, and then enable Push Notifications.
The bridging header must contain the following line:
For more information, see http://apple.co/1NeqEPF.
Apple Push Notification (APNs) allows an app that is not running in the foreground to notify the user that it has information for them. To connect to the APNs services and send mobile app messages to devices, you must provide an explicit App ID when registering with APNs. You cannot use a wildcard App ID. When you generate an explicit App ID, you provide either one of the following valid forms of authentication:
- P8 SSL signing key
- P12 SSL certificate
P8 SSL signing key
If using a P8 SSL signing key to generate an explicit App ID, you can send mobile app messages to all the applications in your Apple org by creating separate App Keys for the applications.
Follow these steps:
- To create an App Key, you need an explicit Bundle ID and the Team ID that represents the Apple org. The Team ID is located at http://developer.apple.com/account under the membership navigation on the left.
- Generate a P8 file and provide this file when creating the App Key. Open http://developer.apple.com/account, click on certificates, identifiers & profiles on the left, and then navigate to the All Keys page. After pressing the plus sign on the top right, select the APNs checkbox and proceed through the steps. At the end, a p8 file is generated by the Apple website, which is named APNsAuthKey_XXXXXXXXXXX.p8. The file and the App Key, replaced by X’s above, is provided in the App Key creation page.
P12 SSL certification
You enable mobile app messages when you create or edit an explict App ID, but mobile app messages are not fully enabled until you generate a client SSL certification. A client SSl certificate allows your notification server to connect to the APNs. Each App ID is required to have its own client SSL certificate.
To configure APNs, go to http://developer.apple.com/account, and then follow these steps:
- Go to Certificates, Identifiers & Profiles > Identifiers, and locate the app ID that you want to use with the Apple Push Notification service. Only app IDs with a specific bundle ID can be used with the APNs. You cannot use a “wildcard” app ID. A bundle ID is a specific identifier for a single app and must be unique to your app.
- Click Edit next to the appropriate app ID.
- Scroll down and select the Push Notifications check box. Click Create Certificate under the type of SSL certificate you want to create: Development or Production. The APNs Assistant guides you through the next series of steps where you create the specific client SSL certificate for your app ID.
- Download the Client SSL certificate file to your download location, and click Done to exit the APNs Assistant.
- Go to the folder where you downloaded the certificate file, and double-click it to install it in your keychain. The application creates an entry that is called Apple Development Push Services:<identifier>.
- Expand the item, and there is a private key (your name or your corporate name), as a child beneath the Push Service.
- Right-click and export the certificate and the private key as .p12 format. As part of the export, it asks that you provide a password for this file, enter a password, and make a record of it.
- Verify your app ID settings by returning to App ID. A green circle followed by Enabled appears in the Push Notifications row and either the Development column or Distribution column, depending on the type of client SSL certificate you created earlier. A yellow circle followed by Configurable in either the Development or Distribution column indicates that there is a missing client SLL certificate.
You set up the profile for the purpos of receiving test notifications. For information about provisioning profiles, see https://developer.apple.com/iphone/manage/provisioningprofiles/index.action.
Follow these steps:
- Go to Certificates, Identifiers & Profiles > Provisioning Profiles.
- Click the Add button (+) in the upper-right corner.
- Select iOS App Development for iOS apps or Mac App Development for Mac apps as the distribution method.
- Select the app ID you want to use for development.
- Select one or more development certificates.
- Select one or more devices.
- Enter a profile name.
- After you download the development or distribution provisioning profiles, they are available for selection under Code Signing Identity for both your Target and Project settings. Select the correct profile for either Development or Distribution. Make sure that you selected the correct provisioning profile for your bundle ID under Build Settings > Code Signing Identity.
RESTRICTION: The provisioning profile that you create must match the push certificate. For example, a Development Provisioning Profile works with a Development Push Certificate. Similarly, there are two “production” distribution profiles: ad hoc and App Store. These provisioning profiles work only with production push certificates. The provisioning profile is bundled with your app. It includes the push entitlement that asks the user for permission to send mobile app messages upon starting your app for the first time.
Updated 7 months ago