{"_id":"55781fe45129590d003ff50d","category":{"_id":"55781fe35129590d003ff4fc","pages":["55781fe45129590d003ff50d","55781fe45129590d003ff50e","55781fe45129590d003ff50f","55781fe45129590d003ff510","55781fe45129590d003ff511","55781fe45129590d003ff512","55781fe45129590d003ff513","55781fe45129590d003ff514","55781fe45129590d003ff515","55781fe45129590d003ff516","55f692b4fe4cce21005c78b0","55f7e91e60cc850d008a7a45","56333cab9c607719001b85e4","564462ed9ce94c0d00068ce9","564f54fa48a1df1700836653","565ee9e7413e06170093dde0","5661a8fdb401c70d00dde6fa","5671348860c8e70d006c96a1","568ce9707d3bf02300aa7734"],"version":"55781fe25129590d003ff4f7","__v":10,"project":"54aa7f773b56130b0056c86e","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-01-05T12:44:00.338Z","from_sync":false,"order":4,"slug":"android-sdk","title":"Android SDK"},"project":"54aa7f773b56130b0056c86e","__v":12,"parentDoc":null,"user":"54aa7f3f9bb00c0b00cb899b","version":{"_id":"55781fe25129590d003ff4f7","project":"54aa7f773b56130b0056c86e","forked_from":"54aa7f773b56130b0056c871","__v":6,"createdAt":"2015-06-10T11:30:42.700Z","releaseDate":"2015-06-10T11:30:42.700Z","categories":["55781fe35129590d003ff4f8","55781fe35129590d003ff4f9","55781fe35129590d003ff4fa","55781fe35129590d003ff4fb","55781fe35129590d003ff4fc","55781fe35129590d003ff4fd","55781fe35129590d003ff4fe","564bbc7e8841060d00abb2ee","565b66c446118c0d00dcb0bb","56898269f8dc340d00308c13","582318b23b961a0f009516a1","594a848c9f4771001a43c959"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"Developers","version_clean":"2.0.0","version":"2.0"},"githubsync":"","updates":["5804c44e542ed60f00bb3ed7"],"next":{"pages":[],"description":""},"createdAt":"2015-01-05T12:54:07.051Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Generating your Google Cloud Messaging API key\"\n}\n[/block]\nBefore push notifications can be enabled for the Pulsate SDK, you must configure your app to recieve push notifications. Once these basic steps are completed, your app will be ready to communicate with the Pulsate Push service.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Step 1: Creating Google Project\"\n}\n[/block]\nOpen the Google Developers Console and create a project\nClick Create Project.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/9fbd7c5-Zrzut_ekranu_17.png\",\n        \"Zrzut ekranu (17).png\",\n        1920,\n        1080,\n        \"#2b5299\"\n      ]\n    }\n  ]\n}\n[/block]\nEnter the name of your project. We recommend to name it the same way your project is named or will be named on the Pulsate website.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/a218c77-Zrzut_ekranu_18.png\",\n        \"Zrzut ekranu (18).png\",\n        1920,\n        1080,\n        \"#dee5f1\"\n      ]\n    }\n  ]\n}\n[/block]\nOnce the project has been created, a page appears that displays your project ID and project number.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/a3bacb4-Zrzut_ekranu_51.png\",\n        \"Zrzut ekranu (51).png\",\n        1920,\n        1080,\n        \"#355ca2\"\n      ]\n    }\n  ]\n}\n[/block]\nCopy and save your project number. The project number will later be added to your Android App and the Pulsate website.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Step 2: Enabling the GCM Service\"\n}\n[/block]\nTo enable the GCM service:\n\nIn the Dashboard you can find a position named \"Use Google APIs\" under it you need to click \"Enable and manage APIs\".\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/ea154c0-Zrzut_ekranu_53.png\",\n        \"Zrzut ekranu (53).png\",\n        1920,\n        1080,\n        \"#355ca2\"\n      ]\n    }\n  ]\n}\n[/block]\nOn the top of the new page that loads click \"ENABLE API\".\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/f2e5a15-Zrzut_ekranu_54.png\",\n        \"Zrzut ekranu (54).png\",\n        1920,\n        1080,\n        \"#36578f\"\n      ]\n    }\n  ]\n}\n[/block]\nYou will be taken to the Google API Library. Type \"Google Cloud Messaging\" in the search bar and click on the result that shows up \"Google Cloud Messaging\".\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/d0aaaf0-Zrzut_ekranu_55.png\",\n        \"Zrzut ekranu (55).png\",\n        1920,\n        1080,\n        \"#f1f2f2\"\n      ]\n    }\n  ]\n}\n[/block]\nOn the next page click \"ENABLE\".\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/919dc60-Zrzut_ekranu_56.png\",\n        \"Zrzut ekranu (56).png\",\n        1920,\n        1080,\n        \"#37598f\"\n      ]\n    }\n  ]\n}\n[/block]\nYou have now enabled Google Cloud Messaging the next step is to create a new API Key.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Step 3: Obtaining an API Key\"\n}\n[/block]\nIn the sidebar on the left, select Credentials.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/f1cfb47-Zrzut_ekranu_57.png\",\n        \"Zrzut ekranu (57).png\",\n        1920,\n        1080,\n        \"#365890\"\n      ]\n    }\n  ]\n}\n[/block]\nOn the next page click \"Create credentials\" and create a new \"API key\".\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/3b6dcb9-Zrzut_ekranu_58.png\",\n        \"Zrzut ekranu (58).png\",\n        1920,\n        1080,\n        \"#365891\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/57f45ba-Zrzut_ekranu_59.png\",\n        \"Zrzut ekranu (59).png\",\n        1920,\n        1080,\n        \"#365891\"\n      ]\n    }\n  ]\n}\n[/block]\nOnce the API key is created a dialog will show up. From the Dialog select \"RESTRICT KEY\".\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/756f99a-Zrzut_ekranu_60.png\",\n        \"Zrzut ekranu (60).png\",\n        1920,\n        1080,\n        \"#e0e6f0\"\n      ]\n    }\n  ]\n}\n[/block]\nOn the next page under \"Key restriction\" select IP addresses, leave the optional IP Addresses list empty and click \"Save\".\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/a2cba62-Zrzut_ekranu_62.png\",\n        \"Zrzut ekranu (62).png\",\n        1920,\n        1080,\n        \"#365890\"\n      ]\n    }\n  ]\n}\n[/block]\nYou will be taken back to the Credentials Page only this time you will see a list of all your API keys.\nFind your key (if this is a new project there will be only one key) and copy and save the value under \"Key\". This value will be later used as the \"API Key\" in the Pulsate App Settings.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/3679656-Zrzut_ekranu_63.png\",\n        \"Zrzut ekranu (63).png\",\n        1920,\n        1080,\n        \"#365892\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Step 4: Pulsate Settings\"\n}\n[/block]\nNow we will add the \"APP ID\" and \"API Key\" to the Pulsate Settings. \nWhen you enter a new Pulsate App you will see this page:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/be8024f-Zrzut_ekranu_21.png\",\n        \"Zrzut ekranu (21).png\",\n        1920,\n        1080,\n        \"#303030\"\n      ]\n    }\n  ]\n}\n[/block]\nIn the top right click on the settings icon and select \"App Settings\".\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/f03d63b-Zrzut_ekranu_22.png\",\n        \"Zrzut ekranu (22).png\",\n        1920,\n        1080,\n        \"#303030\"\n      ]\n    }\n  ]\n}\n[/block]\nOn the new page search for \"Google Cloud Messaging (GCM)\".\nThere you will find two empty fields \"API Key\" and \"APP ID\".\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/7d46f87-Zrzut_ekranu_23.png\",\n        \"Zrzut ekranu (23).png\",\n        1920,\n        1080,\n        \"#2f3e55\"\n      ]\n    }\n  ]\n}\n[/block]\nThe \"Project Number\" you saved from the Google Dev Console is the \"APP ID\".\nThe \"Key\" you saved from the Google Credentials is the \"API Key\".\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/6d4b516-Zrzut_ekranu_65.png\",\n        \"Zrzut ekranu (65).png\",\n        1920,\n        1080,\n        \"#3b4b5f\"\n      ]\n    }\n  ]\n}\n[/block]\nAfter filling in the GCM Details click \"Save\". \nAfter the new settings are successfully saved you will see a dialog show up at the top of the page.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/fc46b83-Zrzut_ekranu_66.png\",\n        \"Zrzut ekranu (66).png\",\n        1920,\n        1080,\n        \"#e1e5d8\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Step 5: Setting the push notification icons\"\n}\n[/block]\nTo setup the push notification icons you need to add 2 drawables to your *\"drawable\"* folders. The first icon must be named *\"ic_notification\"* the second one *\"ic_notification_large\"*. Add these two icons to the following folders *\"drawable\"*, *\"drawable-mdpi\"*,  *\"drawable-hdpi\"*,  *\"drawable-xhdpi\"*,  *\"drawable-xxhdpi\"*,  *\"drawable-xxxhdpi\"*.\n\nThe size of the images should be:\n24px(mdpi)\n36px(hdpi)\n48px(xhdpi)\n72px(xxhdpi)\n96px(xxhdpi)\nThese are used to represent application notifications in the status bar. They should be flat (no gradients), white and face-on perspective. For more info about how to create icons please check this link - https://material.google.com/style/icons.html#icons-system-icons","excerpt":"","slug":"push-notification-configuration","type":"basic","title":"Push Notification Configuration"}

Push Notification Configuration


[block:api-header] { "type": "basic", "title": "Generating your Google Cloud Messaging API key" } [/block] Before push notifications can be enabled for the Pulsate SDK, you must configure your app to recieve push notifications. Once these basic steps are completed, your app will be ready to communicate with the Pulsate Push service. [block:api-header] { "type": "basic", "title": "Step 1: Creating Google Project" } [/block] Open the Google Developers Console and create a project Click Create Project. [block:image] { "images": [ { "image": [ "https://files.readme.io/9fbd7c5-Zrzut_ekranu_17.png", "Zrzut ekranu (17).png", 1920, 1080, "#2b5299" ] } ] } [/block] Enter the name of your project. We recommend to name it the same way your project is named or will be named on the Pulsate website. [block:image] { "images": [ { "image": [ "https://files.readme.io/a218c77-Zrzut_ekranu_18.png", "Zrzut ekranu (18).png", 1920, 1080, "#dee5f1" ] } ] } [/block] Once the project has been created, a page appears that displays your project ID and project number. [block:image] { "images": [ { "image": [ "https://files.readme.io/a3bacb4-Zrzut_ekranu_51.png", "Zrzut ekranu (51).png", 1920, 1080, "#355ca2" ] } ] } [/block] Copy and save your project number. The project number will later be added to your Android App and the Pulsate website. [block:api-header] { "type": "basic", "title": "Step 2: Enabling the GCM Service" } [/block] To enable the GCM service: In the Dashboard you can find a position named "Use Google APIs" under it you need to click "Enable and manage APIs". [block:image] { "images": [ { "image": [ "https://files.readme.io/ea154c0-Zrzut_ekranu_53.png", "Zrzut ekranu (53).png", 1920, 1080, "#355ca2" ] } ] } [/block] On the top of the new page that loads click "ENABLE API". [block:image] { "images": [ { "image": [ "https://files.readme.io/f2e5a15-Zrzut_ekranu_54.png", "Zrzut ekranu (54).png", 1920, 1080, "#36578f" ] } ] } [/block] You will be taken to the Google API Library. Type "Google Cloud Messaging" in the search bar and click on the result that shows up "Google Cloud Messaging". [block:image] { "images": [ { "image": [ "https://files.readme.io/d0aaaf0-Zrzut_ekranu_55.png", "Zrzut ekranu (55).png", 1920, 1080, "#f1f2f2" ] } ] } [/block] On the next page click "ENABLE". [block:image] { "images": [ { "image": [ "https://files.readme.io/919dc60-Zrzut_ekranu_56.png", "Zrzut ekranu (56).png", 1920, 1080, "#37598f" ] } ] } [/block] You have now enabled Google Cloud Messaging the next step is to create a new API Key. [block:api-header] { "type": "basic", "title": "Step 3: Obtaining an API Key" } [/block] In the sidebar on the left, select Credentials. [block:image] { "images": [ { "image": [ "https://files.readme.io/f1cfb47-Zrzut_ekranu_57.png", "Zrzut ekranu (57).png", 1920, 1080, "#365890" ] } ] } [/block] On the next page click "Create credentials" and create a new "API key". [block:image] { "images": [ { "image": [ "https://files.readme.io/3b6dcb9-Zrzut_ekranu_58.png", "Zrzut ekranu (58).png", 1920, 1080, "#365891" ] } ] } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/57f45ba-Zrzut_ekranu_59.png", "Zrzut ekranu (59).png", 1920, 1080, "#365891" ] } ] } [/block] Once the API key is created a dialog will show up. From the Dialog select "RESTRICT KEY". [block:image] { "images": [ { "image": [ "https://files.readme.io/756f99a-Zrzut_ekranu_60.png", "Zrzut ekranu (60).png", 1920, 1080, "#e0e6f0" ] } ] } [/block] On the next page under "Key restriction" select IP addresses, leave the optional IP Addresses list empty and click "Save". [block:image] { "images": [ { "image": [ "https://files.readme.io/a2cba62-Zrzut_ekranu_62.png", "Zrzut ekranu (62).png", 1920, 1080, "#365890" ] } ] } [/block] You will be taken back to the Credentials Page only this time you will see a list of all your API keys. Find your key (if this is a new project there will be only one key) and copy and save the value under "Key". This value will be later used as the "API Key" in the Pulsate App Settings. [block:image] { "images": [ { "image": [ "https://files.readme.io/3679656-Zrzut_ekranu_63.png", "Zrzut ekranu (63).png", 1920, 1080, "#365892" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "Step 4: Pulsate Settings" } [/block] Now we will add the "APP ID" and "API Key" to the Pulsate Settings. When you enter a new Pulsate App you will see this page: [block:image] { "images": [ { "image": [ "https://files.readme.io/be8024f-Zrzut_ekranu_21.png", "Zrzut ekranu (21).png", 1920, 1080, "#303030" ] } ] } [/block] In the top right click on the settings icon and select "App Settings". [block:image] { "images": [ { "image": [ "https://files.readme.io/f03d63b-Zrzut_ekranu_22.png", "Zrzut ekranu (22).png", 1920, 1080, "#303030" ] } ] } [/block] On the new page search for "Google Cloud Messaging (GCM)". There you will find two empty fields "API Key" and "APP ID". [block:image] { "images": [ { "image": [ "https://files.readme.io/7d46f87-Zrzut_ekranu_23.png", "Zrzut ekranu (23).png", 1920, 1080, "#2f3e55" ] } ] } [/block] The "Project Number" you saved from the Google Dev Console is the "APP ID". The "Key" you saved from the Google Credentials is the "API Key". [block:image] { "images": [ { "image": [ "https://files.readme.io/6d4b516-Zrzut_ekranu_65.png", "Zrzut ekranu (65).png", 1920, 1080, "#3b4b5f" ] } ] } [/block] After filling in the GCM Details click "Save". After the new settings are successfully saved you will see a dialog show up at the top of the page. [block:image] { "images": [ { "image": [ "https://files.readme.io/fc46b83-Zrzut_ekranu_66.png", "Zrzut ekranu (66).png", 1920, 1080, "#e1e5d8" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "Step 5: Setting the push notification icons" } [/block] To setup the push notification icons you need to add 2 drawables to your *"drawable"* folders. The first icon must be named *"ic_notification"* the second one *"ic_notification_large"*. Add these two icons to the following folders *"drawable"*, *"drawable-mdpi"*, *"drawable-hdpi"*, *"drawable-xhdpi"*, *"drawable-xxhdpi"*, *"drawable-xxxhdpi"*. The size of the images should be: 24px(mdpi) 36px(hdpi) 48px(xhdpi) 72px(xxhdpi) 96px(xxhdpi) These are used to represent application notifications in the status bar. They should be flat (no gradients), white and face-on perspective. For more info about how to create icons please check this link - https://material.google.com/style/icons.html#icons-system-icons