{"_id":"56d1f33d00a2a70b00b365e7","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"},"parentDoc":null,"project":"5526c95cf69851170038b48f","__v":2,"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"},"user":"5526d4bb4a7ac121004c605c","updates":["5746e4e6dc0cc01700d0976e"],"next":{"pages":[],"description":""},"createdAt":"2015-12-04T20:11:32.870Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"Android push notifications use the **Google Cloud Messaging (GCM)** service.\n\n## Step 1: Setting up GCM\n\n### 1.1: Creating a Google API project\n\n* Open the [Google Developers Console](https://cloud.google.com/console).\n* If you haven't created an API project yet, click **Create Project**.\n* Supply a project name and ID, then click **Create**.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/ggY5WjOQtGIWCftO63jg_Screen%20Shot%202016-02-29%20at%209.57.50%20AM.png\",\n        \"Screen Shot 2016-02-29 at 9.57.50 AM.png\",\n        \"1156\",\n        \"928\",\n        \"#9a8a5c\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n* Once the project has been created, a page appears that displays your project ID and **project number** as seen below.  Copy down your **project number**. You will use it later on as the **GCM sender ID**.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/wi9jPgwVQNWWaLWw1508_Screen%20Shot%202016-02-29%20at%209.59.06%20AM.png\",\n        \"Screen Shot 2016-02-29 at 9.59.06 AM.png\",\n        \"1155\",\n        \"656\",\n        \"#3e57ba\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n### 1.2: Enabling the GCM service\n\n* In the **Use Google API's** section, select **Enable and manage API's**.\n* In the displayed list of APIs, find the **Google Cloud Messaging for Android** link.\n* Click **Enable API**.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/mvkLdY6SCCDO8mGqKuhH_Screen%20Shot%202016-02-29%20at%2010.00.44%20AM.png\",\n        \"Screen Shot 2016-02-29 at 10.00.44 AM.png\",\n        \"1155\",\n        \"688\",\n        \"#4057ae\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/mpB1RdCRKB17RTDrDwVw_Screen%20Shot%202016-02-29%20at%2010.00.53%20AM.png\",\n        \"Screen Shot 2016-02-29 at 10.00.53 AM.png\",\n        \"1155\",\n        \"688\",\n        \"#3f57a7\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n### 1.3: Obtaining an API key\n\n* Navigate to the **Credentials** section in the side menu on the left.\n* Select **Create credentials**, then choose **API Key**, then **Server Key**.\n* Name your API key and leave the **Accept requests from...** field blank.\n* Click **Create**.  You should see your newly created API key as below.\n* **Save your API key!**  You're going to need it later to hook up Ionic.io.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/vmdpGYe4SNON3OjVaHTW_Screen%20Shot%202016-02-29%20at%2010.05.47%20AM.png\",\n        \"Screen Shot 2016-02-29 at 10.05.47 AM.png\",\n        \"1155\",\n        \"688\",\n        \"#9c875d\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n## Step 2: Hooking up ionic.io\n\nFirst things first, you need to set your **project number** within your current Ionic app.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"ionic config set gcm_key <your-gcm-project-number>\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nNext, go to your app's dashboard on the [Ionic Platform](https://apps.ionic.io/apps) and 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/x4YG7ZpiTHCNiLTrmYDa_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, click the **Android** tab and find the section marked **Google Cloud Messaging**, enter the **API Key** you generated on the Google Developer Console, then click **Save**.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/6FQofFzzSOgfjmYqcrS1_Screen%20Shot%202015-12-07%20at%2011.33.41%20AM.png\",\n        \"Screen Shot 2015-12-07 at 11.33.41 AM.png\",\n        \"1271\",\n        \"975\",\n        \"#2dbb4c\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\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":"android-push-profiles","type":"basic","title":"Android Push Profiles"}

Android Push Profiles


Android push notifications use the **Google Cloud Messaging (GCM)** service. ## Step 1: Setting up GCM ### 1.1: Creating a Google API project * Open the [Google Developers Console](https://cloud.google.com/console). * If you haven't created an API project yet, click **Create Project**. * Supply a project name and ID, then click **Create**. [block:image] { "images": [ { "image": [ "https://files.readme.io/ggY5WjOQtGIWCftO63jg_Screen%20Shot%202016-02-29%20at%209.57.50%20AM.png", "Screen Shot 2016-02-29 at 9.57.50 AM.png", "1156", "928", "#9a8a5c", "" ] } ] } [/block] * Once the project has been created, a page appears that displays your project ID and **project number** as seen below. Copy down your **project number**. You will use it later on as the **GCM sender ID**. [block:image] { "images": [ { "image": [ "https://files.readme.io/wi9jPgwVQNWWaLWw1508_Screen%20Shot%202016-02-29%20at%209.59.06%20AM.png", "Screen Shot 2016-02-29 at 9.59.06 AM.png", "1155", "656", "#3e57ba", "" ] } ] } [/block] ### 1.2: Enabling the GCM service * In the **Use Google API's** section, select **Enable and manage API's**. * In the displayed list of APIs, find the **Google Cloud Messaging for Android** link. * Click **Enable API**. [block:image] { "images": [ { "image": [ "https://files.readme.io/mvkLdY6SCCDO8mGqKuhH_Screen%20Shot%202016-02-29%20at%2010.00.44%20AM.png", "Screen Shot 2016-02-29 at 10.00.44 AM.png", "1155", "688", "#4057ae", "" ] } ] } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/mpB1RdCRKB17RTDrDwVw_Screen%20Shot%202016-02-29%20at%2010.00.53%20AM.png", "Screen Shot 2016-02-29 at 10.00.53 AM.png", "1155", "688", "#3f57a7", "" ] } ] } [/block] ### 1.3: Obtaining an API key * Navigate to the **Credentials** section in the side menu on the left. * Select **Create credentials**, then choose **API Key**, then **Server Key**. * Name your API key and leave the **Accept requests from...** field blank. * Click **Create**. You should see your newly created API key as below. * **Save your API key!** You're going to need it later to hook up Ionic.io. [block:image] { "images": [ { "image": [ "https://files.readme.io/vmdpGYe4SNON3OjVaHTW_Screen%20Shot%202016-02-29%20at%2010.05.47%20AM.png", "Screen Shot 2016-02-29 at 10.05.47 AM.png", "1155", "688", "#9c875d", "" ] } ] } [/block] ## Step 2: Hooking up ionic.io First things first, you need to set your **project number** within your current Ionic app. [block:code] { "codes": [ { "code": "ionic config set gcm_key <your-gcm-project-number>", "language": "shell" } ] } [/block] Next, go to your app's dashboard on the [Ionic Platform](https://apps.ionic.io/apps) and 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/x4YG7ZpiTHCNiLTrmYDa_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, click the **Android** tab and find the section marked **Google Cloud Messaging**, enter the **API Key** you generated on the Google Developer Console, then click **Save**. [block:image] { "images": [ { "image": [ "https://files.readme.io/6FQofFzzSOgfjmYqcrS1_Screen%20Shot%202015-12-07%20at%2011.33.41%20AM.png", "Screen Shot 2015-12-07 at 11.33.41 AM.png", "1271", "975", "#2dbb4c", "" ] } ] } [/block] [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]