{"_id":"56d1f33d00a2a70b00b365e5","parentDoc":null,"user":"5526d4bb4a7ac121004c605c","category":{"_id":"56d1f33900a2a70b00b36591","__v":1,"version":"56d1f33700a2a70b00b3658e","pages":["56d1f33d00a2a70b00b365e3","56d1f33d00a2a70b00b365e4","56d1f33d00a2a70b00b365e5","56d1f33d00a2a70b00b365e6","56d1f33d00a2a70b00b365e7"],"project":"5526c95cf69851170038b48f","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-12-04T20:08:13.640Z","from_sync":false,"order":1,"slug":"security-profiles","title":"Security Profiles"},"project":"5526c95cf69851170038b48f","version":{"_id":"56d1f33700a2a70b00b3658e","project":"5526c95cf69851170038b48f","__v":2,"createdAt":"2016-02-27T19:04:23.946Z","releaseDate":"2016-02-27T19:04:23.946Z","categories":["56d1f33900a2a70b00b3658f","56d1f33900a2a70b00b36590","56d1f33900a2a70b00b36591","56d1f33900a2a70b00b36592","56d1f33900a2a70b00b36593","56d1f33900a2a70b00b36594","56d1f33900a2a70b00b36595","56d1f33900a2a70b00b36596","56d1f33900a2a70b00b36597","56d1f33900a2a70b00b36598","56d1f33900a2a70b00b36599","56d1f33900a2a70b00b3659a","571f9497ada30c34003b7cee"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"beta","version_clean":"2.0.0-beta","version":"2.0.0-beta"},"__v":1,"updates":["56d7423bad6eef25003f9578"],"next":{"pages":[],"description":""},"createdAt":"2015-12-04T20:10:59.739Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"Sending push notifications on iOS requires generating push certificates from the **iOS Dev Center**, then building a provisioning profile for your app.\n\n## Step 1: Generating an SSL certificate\n\n### 1.1: The certificate request\n\nFirst, we're going to need to generate a certificate signing request file.  This is used to authenticate the creation of an SSL certificate.\n\n* Launch the **Keychain Access** application on your Mac.  It will likely be in the \n**Applications/Utilities** folder.\n* Navigate to **Keychain Access** > **Certificate Assistant** > \n**Request a Certificate From a Certificate Authority**\n* Enter your name and email address.\n* Select **Saved to disk** and hit **continue**.  This will download your \n`.certSigningRequest` file.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/fNBIXoacRoiSZVdjJtUO_keychain-access.png\",\n        \"keychain-access.png\",\n        \"728\",\n        \"548\",\n        \"#2c385c\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n### 1.2: The App ID\n\niOS applications installed on your development devices require a custom iOS App ID (not to be confused with your Ionic App ID).  For this example, you may use an ID that you \nhave already created, or create a new one.  We'll describe how to create a new one below.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"As a convention, iOS App ID's are represented as a reversed address (for example `com.ionicframework.IonicPushApp`).\",\n  \"title\": \"Note:\"\n}\n[/block]\n\n* Go to the [Apple Developer Center](https://developer.apple.com/membercenter/index.action).\n* Select **Certificates, Identifiers, & Profiles**:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/nV0WcVlRbWp0FvQAQZzU_certs-dash.png\",\n        \"certs-dash.png\",\n        \"1085\",\n        \"597\",\n        \"#994d46\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n* Select **Identifiers** under the iOS Apps section.\n* Here, you're going to see a list of your iOS App IDs.  Hit the **+** button in the top-right corner to register a new one.\n* Choose a name for your new App ID and make sure to **select the checkbox for Push Notifications** under App Services.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/vFXJOmnT6qqiWV4MhM7s_push-checkbox.png\",\n        \"push-checkbox.png\",\n        \"1548\",\n        \"989\",\n        \"#3db25f\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n* Choose an App ID Prefix (in most cases, the default will be just fine).\n* For App ID Suffix, you need to select Explicit App ID and enter your iOS app's bundle ID.  This string should match the ID you've specified in your Ionic project's config.xml file.\n* Hit **Continue** and make sure that all information was entered correctly.  Push Notifications should show up as **Configurable**.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/7SEo2rk3RFGBmcmHWOSQ_app-confirm-screen.png\",\n        \"app-confirm-screen.png\",\n        \"1548\",\n        \"989\",\n        \"#b05043\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Hey, listen!\",\n  \"body\": \"Make sure to click Submit at the bottom of this page to save your App ID!\"\n}\n[/block]\n\n### 1.3: Configuring the App ID\n\nNow that your App ID is successfully created, it's time to configure it to send some Push Notifications.\n\n* From the list of available iOS App IDs, select your new ID, then click **Edit**.\n* Scroll down to the **Push Notifications** section of you app and click **Create Certificate** under the Development SSL Certificate section.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/1Sv2peMbTdm4SswISLkS_edit-app-push-section.png\",\n        \"edit-app-push-section.png\",\n        \"945\",\n        \"989\",\n        \"#ba5549\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n* The next screen will give you instructions to create a certificate signing request, which you have already done in the first section of this tutorial (this is the .certSigningRequest file you created).\n* Once you have located your signing request, click **Continue** and follow the instructions to upload your file and generate a new certificate.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/EoXkEZQeKlnEapKg0tkg_edit-app-download-ssl.png\",\n        \"edit-app-download-ssl.png\",\n        \"899\",\n        \"1025\",\n        \"#b6564b\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n* Once the certificate is ready, download it from the App ID Edit screen and double click on the downloaded certificate to install it to your keychain.\n* In Keychain Access, under **My Certificates**, find the certificate you just added.  It should be called **Apple Development IOS Push Services**.\n* Right Click on it, select **Export Apple Development IOS...**, and save it as a **.p12** \nfile.  You will be prompted to enter a password which will be used to protect the exported certificate.\n* You may be asked to enter your OSX password at this point.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/1wVHf8R7QmguKZctjhgy_keychain-access-export.png\",\n        \"keychain-access-export.png\",\n        \"961\",\n        \"639\",\n        \"#3d4c71\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Hey, Listen!\",\n  \"body\": \"If the certificate export does not allow you to choose .p12, double check that you've selected **My Certificates** in the left menu before selecting your certificate.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"success\",\n  \"title\": \"Success!\",\n  \"body\": \"Congratulations! You've just enabled Push Notification for your app in development mode.  Before you release you app to the app store, you need to repeat the previous steps, but instead generate a **Production Push SSL Certificate**.\"\n}\n[/block]\n## Step 2: Creating a Provisioning Profile\n\nA Provisioning profile authenticates your device to run the app that you're developing.  Whether you're using an existing App ID or have created a new one, you're going to need to regenerate and install a Provisioning Profile. In this tutorial, we're going to create a new profile.\n\n* Go to the [Apple Developer Center](https://developer.apple.com/membercenter/index.action).\n* Select **Certificates, Identifiers, & Profiles**.\n* Select **Provisioning Profiles** under the iOS Apps section.\n* Select the **+** in the top-right of the screen to create a new iOS Provisioning Profile.\n* Select **iOS App Development** as your profile type, then select **Continue**.\n* Select the App ID you created in Section 1, then select **Continue**.\n* Select the iOS development certificate you created on the next screen, then select **Continue**.\n* You will now be asked which devices will be included in your provisioning profile.  Select all of your development devices then hit **Continue**.\n* Choose a descriptive name for the profile, then hit **Generate**.\n* Download the profile from the next screen with the **Download** button, then install it by double clicking on it (This may open Xcode).\n\n## Step 3: Ensure the bundle identifier is correct\n\nBecause of the way Apple uses provisioning profiles, the app ID you specify on the Apple Developer site...\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/r6i84PSRdGpO2TfzX0rh_ios-app-ids.png\",\n        \"ios-app-ids.png\",\n        \"2136\",\n        \"1224\",\n        \"#936a68\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n...should match the bundle identifier you see in xCode...\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/FE8oCKarR3ywlvTy7OsV_xcode-ios-bundle.png\",\n        \"xcode-ios-bundle.png\",\n        \"2426\",\n        \"1370\",\n        \"#52a5d4\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n...which can be ensured by editing the <code>config.xml</code> file at the root of your project.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/9KjD62yORzWaX0Euu3HE_config-xml-note.png\",\n        \"config-xml-note.png\",\n        \"2588\",\n        \"1252\",\n        \"#427ecf\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n## Step 4: Hooking up ionic.io\n\nNow that you have your iOS credentials in order, let's upload them to Ionic to get started with Push!  \n\nFirst, go to your app's dashboard on the [Ionic Platform](https://apps.ionic.io/apps), then navigate to **Settings** -> **Certificates**.  If you haven't already, create a new security profile, then hit **edit**.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/lGRwixjTb6AeuDEJeNTx_Screen%20Shot%202015-12-07%20at%2011.24.19%20AM.png\",\n        \"Screen Shot 2015-12-07 at 11.24.19 AM.png\",\n        \"1167\",\n        \"831\",\n        \"#6093dc\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nNow, find the section marked **Push Notification Service**, choose your **.p12** certificate, and enter the associated password.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/qqiYX17TfCA2lm4PcEn8_Screen%20Shot%202015-12-07%20at%2011.24.32%20AM.png\",\n        \"Screen Shot 2015-12-07 at 11.24.32 AM.png\",\n        \"1167\",\n        \"831\",\n        \"#32bc68\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nNow, hit **Save**.\n[block:callout]\n{\n  \"type\": \"success\",\n  \"body\": \"That's all there is, make sure your Ionic app is properly configured, and you're ready to go!\",\n  \"title\": \"All Done!\"\n}\n[/block]","excerpt":"","slug":"ios-push-profiles","type":"basic","title":"iOS Push Profiles"}
Sending push notifications on iOS requires generating push certificates from the **iOS Dev Center**, then building a provisioning profile for your app. ## Step 1: Generating an SSL certificate ### 1.1: The certificate request First, we're going to need to generate a certificate signing request file. This is used to authenticate the creation of an SSL certificate. * Launch the **Keychain Access** application on your Mac. It will likely be in the **Applications/Utilities** folder. * Navigate to **Keychain Access** > **Certificate Assistant** > **Request a Certificate From a Certificate Authority** * Enter your name and email address. * Select **Saved to disk** and hit **continue**. This will download your `.certSigningRequest` file. [block:image] { "images": [ { "image": [ "https://files.readme.io/fNBIXoacRoiSZVdjJtUO_keychain-access.png", "keychain-access.png", "728", "548", "#2c385c", "" ] } ] } [/block] ### 1.2: The App ID iOS applications installed on your development devices require a custom iOS App ID (not to be confused with your Ionic App ID). For this example, you may use an ID that you have already created, or create a new one. We'll describe how to create a new one below. [block:callout] { "type": "info", "body": "As a convention, iOS App ID's are represented as a reversed address (for example `com.ionicframework.IonicPushApp`).", "title": "Note:" } [/block] * Go to the [Apple Developer Center](https://developer.apple.com/membercenter/index.action). * Select **Certificates, Identifiers, & Profiles**: [block:image] { "images": [ { "image": [ "https://files.readme.io/nV0WcVlRbWp0FvQAQZzU_certs-dash.png", "certs-dash.png", "1085", "597", "#994d46", "" ] } ] } [/block] * Select **Identifiers** under the iOS Apps section. * Here, you're going to see a list of your iOS App IDs. Hit the **+** button in the top-right corner to register a new one. * Choose a name for your new App ID and make sure to **select the checkbox for Push Notifications** under App Services. [block:image] { "images": [ { "image": [ "https://files.readme.io/vFXJOmnT6qqiWV4MhM7s_push-checkbox.png", "push-checkbox.png", "1548", "989", "#3db25f", "" ] } ] } [/block] * Choose an App ID Prefix (in most cases, the default will be just fine). * For App ID Suffix, you need to select Explicit App ID and enter your iOS app's bundle ID. This string should match the ID you've specified in your Ionic project's config.xml file. * Hit **Continue** and make sure that all information was entered correctly. Push Notifications should show up as **Configurable**. [block:image] { "images": [ { "image": [ "https://files.readme.io/7SEo2rk3RFGBmcmHWOSQ_app-confirm-screen.png", "app-confirm-screen.png", "1548", "989", "#b05043", "" ] } ] } [/block] [block:callout] { "type": "info", "title": "Hey, listen!", "body": "Make sure to click Submit at the bottom of this page to save your App ID!" } [/block] ### 1.3: Configuring the App ID Now that your App ID is successfully created, it's time to configure it to send some Push Notifications. * From the list of available iOS App IDs, select your new ID, then click **Edit**. * Scroll down to the **Push Notifications** section of you app and click **Create Certificate** under the Development SSL Certificate section. [block:image] { "images": [ { "image": [ "https://files.readme.io/1Sv2peMbTdm4SswISLkS_edit-app-push-section.png", "edit-app-push-section.png", "945", "989", "#ba5549", "" ] } ] } [/block] * The next screen will give you instructions to create a certificate signing request, which you have already done in the first section of this tutorial (this is the .certSigningRequest file you created). * Once you have located your signing request, click **Continue** and follow the instructions to upload your file and generate a new certificate. [block:image] { "images": [ { "image": [ "https://files.readme.io/EoXkEZQeKlnEapKg0tkg_edit-app-download-ssl.png", "edit-app-download-ssl.png", "899", "1025", "#b6564b", "" ] } ] } [/block] * Once the certificate is ready, download it from the App ID Edit screen and double click on the downloaded certificate to install it to your keychain. * In Keychain Access, under **My Certificates**, find the certificate you just added. It should be called **Apple Development IOS Push Services**. * Right Click on it, select **Export Apple Development IOS...**, and save it as a **.p12** file. You will be prompted to enter a password which will be used to protect the exported certificate. * You may be asked to enter your OSX password at this point. [block:image] { "images": [ { "image": [ "https://files.readme.io/1wVHf8R7QmguKZctjhgy_keychain-access-export.png", "keychain-access-export.png", "961", "639", "#3d4c71", "" ] } ] } [/block] [block:callout] { "type": "info", "title": "Hey, Listen!", "body": "If the certificate export does not allow you to choose .p12, double check that you've selected **My Certificates** in the left menu before selecting your certificate." } [/block] [block:callout] { "type": "success", "title": "Success!", "body": "Congratulations! You've just enabled Push Notification for your app in development mode. Before you release you app to the app store, you need to repeat the previous steps, but instead generate a **Production Push SSL Certificate**." } [/block] ## Step 2: Creating a Provisioning Profile A Provisioning profile authenticates your device to run the app that you're developing. Whether you're using an existing App ID or have created a new one, you're going to need to regenerate and install a Provisioning Profile. In this tutorial, we're going to create a new profile. * Go to the [Apple Developer Center](https://developer.apple.com/membercenter/index.action). * Select **Certificates, Identifiers, & Profiles**. * Select **Provisioning Profiles** under the iOS Apps section. * Select the **+** in the top-right of the screen to create a new iOS Provisioning Profile. * Select **iOS App Development** as your profile type, then select **Continue**. * Select the App ID you created in Section 1, then select **Continue**. * Select the iOS development certificate you created on the next screen, then select **Continue**. * You will now be asked which devices will be included in your provisioning profile. Select all of your development devices then hit **Continue**. * Choose a descriptive name for the profile, then hit **Generate**. * Download the profile from the next screen with the **Download** button, then install it by double clicking on it (This may open Xcode). ## Step 3: Ensure the bundle identifier is correct Because of the way Apple uses provisioning profiles, the app ID you specify on the Apple Developer site... [block:image] { "images": [ { "image": [ "https://files.readme.io/r6i84PSRdGpO2TfzX0rh_ios-app-ids.png", "ios-app-ids.png", "2136", "1224", "#936a68", "" ] } ] } [/block] ...should match the bundle identifier you see in xCode... [block:image] { "images": [ { "image": [ "https://files.readme.io/FE8oCKarR3ywlvTy7OsV_xcode-ios-bundle.png", "xcode-ios-bundle.png", "2426", "1370", "#52a5d4", "" ] } ] } [/block] ...which can be ensured by editing the <code>config.xml</code> file at the root of your project. [block:image] { "images": [ { "image": [ "https://files.readme.io/9KjD62yORzWaX0Euu3HE_config-xml-note.png", "config-xml-note.png", "2588", "1252", "#427ecf", "" ] } ] } [/block] ## Step 4: Hooking up ionic.io Now that you have your iOS credentials in order, let's upload them to Ionic to get started with Push! First, go to your app's dashboard on the [Ionic Platform](https://apps.ionic.io/apps), then navigate to **Settings** -> **Certificates**. If you haven't already, create a new security profile, then hit **edit**. [block:image] { "images": [ { "image": [ "https://files.readme.io/lGRwixjTb6AeuDEJeNTx_Screen%20Shot%202015-12-07%20at%2011.24.19%20AM.png", "Screen Shot 2015-12-07 at 11.24.19 AM.png", "1167", "831", "#6093dc", "" ] } ] } [/block] Now, find the section marked **Push Notification Service**, choose your **.p12** certificate, and enter the associated password. [block:image] { "images": [ { "image": [ "https://files.readme.io/qqiYX17TfCA2lm4PcEn8_Screen%20Shot%202015-12-07%20at%2011.24.32%20AM.png", "Screen Shot 2015-12-07 at 11.24.32 AM.png", "1167", "831", "#32bc68", "" ] } ] } [/block] Now, hit **Save**. [block:callout] { "type": "success", "body": "That's all there is, make sure your Ionic app is properly configured, and you're ready to go!", "title": "All Done!" } [/block]