{"_id":"583bf677f2f6d10f001702c3","parentDoc":null,"__v":0,"user":"55a5003a750a9a23005332b6","version":{"_id":"5540ce1c31827a0d007ab1cf","project":"5540ce1b31827a0d007ab1cc","__v":31,"createdAt":"2015-04-29T12:27:08.390Z","releaseDate":"2015-04-29T12:27:08.390Z","categories":["5540ce1c31827a0d007ab1d0","5540d91bbb9e762d00f594ad","5540e5f131827a0d007ab212","5540e5febb9e762d00f594d3","5540e61331827a0d007ab213","5540e6195cf9682100d61afa","5540e62631827a0d007ab214","5540e63031827a0d007ab215","5540e63531827a0d007ab216","5540e63e5cf9682100d61afc","5540e6445cf9682100d61afd","5540e64a5cf9682100d61afe","55a4ff5b2e70c0250038050f","55acb28318eefd0d0071d504","55ae1abe8576b92300291c80","55ae453ef302af23000ac109","55af586d555b900d0036d296","55af91dac8a85321007a53c3","55b9fee204775a2f00628071","55b9ff0e04775a2f00628072","55b9ff4604775a2f00628073","55b9ff5fd72d1e1900276a38","55b9ff7f04775a2f00628074","55b9ff90eb08801900f833e5","55b9ffa5d72d1e1900276a39","55b9ffca04775a2f00628075","55b9fffdd72d1e1900276a3a","56bc2f033ee9e70d008b46af","56c2f6efbbf9ec2d00e0fe4f","57595bbb18760817001e8bbe","57d8d9793916800e003dde53"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"project":"5540ce1b31827a0d007ab1cc","category":{"_id":"5540e5f131827a0d007ab212","__v":15,"project":"5540ce1b31827a0d007ab1cc","pages":["5540e66b31827a0d007ab217","5540e67731827a0d007ab219","55ac917b5863b817008ae3b4","55acaa4c6b4ff90d00784a92","55acb96418eefd0d0071d553","55acc8aa18eefd0d0071d596","55accd2818eefd0d0071d5a8","55acd06518eefd0d0071d5b6","55acddd7fb7b3c19003739cc","55ace14bfb7b3c19003739d3","55ace3a9fb7b3c19003739d7","55acea24f93f0c0d005b880f","55acf15bf93f0c0d005b8821","55acf3cd18eefd0d0071d5fb","55d1f1c0486de50d00326f17"],"version":"5540ce1c31827a0d007ab1cf","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-04-29T14:08:49.271Z","from_sync":false,"order":4,"slug":"android","title":"Android"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-11-28T09:18:47.180Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"[block:callout]\n{\n  \"type\": \"success\",\n  \"title\": \"Please pay attention!\",\n  \"body\": \"The following steps will also help you to enable Cloud Messaging for your Android app in case you already had GCM configured but Credentials became invalid due to the last Google update.\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Enable FCM and Get Credentials\"\n}\n[/block]\n**1.** Go to https://console.firebase.google.com/ and import your Google project to Firebase.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/0fb7cfd-step-3.png\",\n        \"step-3.png\",\n        638,\n        280,\n        \"#e7eaf3\"\n      ]\n    }\n  ]\n}\n[/block]\n**2.** Check if you selected a correct Project, select a Country and click Add Firebase.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/f16f115-step-4.png\",\n        \"step-4.png\",\n        441,\n        427,\n        \"#fafafa\"\n      ]\n    }\n  ]\n}\n[/block]\n**3.** Go to the Project Settings and select Cloud Messaging.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/b8ab172-step-5.png\",\n        \"step-5.png\",\n        476,\n        265,\n        \"#058ed4\"\n      ]\n    }\n  ]\n}\n[/block]\n**4.** Copy the provided Firebase Cloud Messaging Token and Sender ID to your Pushwoosh Control Panel. \n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/ba80fbd-step-6.png\",\n        \"step-6.png\",\n        895,\n        540,\n        \"#e7e7ef\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"body\": \"Check that the Google Project Number (GCM Sender ID) in your **[AndroidManifest.xml](http://docs.pushwoosh.com/docs/android-sdk-fragments#writing-code)** file matches the one in your Firebase Console.\",\n  \"title\": \"Important\"\n}\n[/block]\n**5.** Here’s the API key you will need to configure your application in Pushwoosh Control Panel.\n\nGo to the Pushwoosh Control Panel\n\n**6.** In your application click on **Android->Edit** to change the configuration for Android application.\n\n**7.** Copy your **Firebase Cloud Messaging Token** to the **API Key**.\n\n**8.** Copy your **Sender ID** to the **GCM Sender ID** field.\n[block:callout]\n{\n  \"type\": \"success\",\n  \"title\": \"GCM Sender ID\",\n  \"body\": \"**GCM Sender ID** is a unique numerical value created when you configure your Google project (given as **Project Number** in the Google Developers Console and as **Sender ID** in the Firebase console). In order to locate your Project Number please go to [**Android FAQ**](http://docs.pushwoosh.com/docs/android-faq#how-to-locate-my-google-project-number)\"\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/2b8b7cf-step-7.png\",\n        \"step-7.png\",\n        595,\n        419,\n        \"#0ca4ec\"\n      ]\n    }\n  ]\n}\n[/block]\nThat’s it! Easy, isn’t it?\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"MismatchSenderID error\",\n  \"body\": \"If you see “MismatchSenderID” errors in your Push History, please try the following:\\n\\n* Check that the Google Project Number in your app matches the one in your Google Developers Console.\\n\\n* Firebase is deprecating Server Keys and replacing them with Firebase Cloud Messaging Tokens, and occasionally Server Keys may just stop working. If you still use Server Key as the API key when configuring your Pushwoosh Android app and get the MismatchSenderID error, please make sure to use **Firebase Cloud Messaging Token** instead of the **Server Key**.\"\n}\n[/block]","excerpt":"Follow the steps below to enable the FCM (GCM) service for your Android project","slug":"fcm-configuration","type":"basic","title":"FCM (former GCM) Configuration"}

FCM (former GCM) Configuration

Follow the steps below to enable the FCM (GCM) service for your Android project

[block:callout] { "type": "success", "title": "Please pay attention!", "body": "The following steps will also help you to enable Cloud Messaging for your Android app in case you already had GCM configured but Credentials became invalid due to the last Google update." } [/block] [block:api-header] { "type": "basic", "title": "Enable FCM and Get Credentials" } [/block] **1.** Go to https://console.firebase.google.com/ and import your Google project to Firebase. [block:image] { "images": [ { "image": [ "https://files.readme.io/0fb7cfd-step-3.png", "step-3.png", 638, 280, "#e7eaf3" ] } ] } [/block] **2.** Check if you selected a correct Project, select a Country and click Add Firebase. [block:image] { "images": [ { "image": [ "https://files.readme.io/f16f115-step-4.png", "step-4.png", 441, 427, "#fafafa" ] } ] } [/block] **3.** Go to the Project Settings and select Cloud Messaging. [block:image] { "images": [ { "image": [ "https://files.readme.io/b8ab172-step-5.png", "step-5.png", 476, 265, "#058ed4" ] } ] } [/block] **4.** Copy the provided Firebase Cloud Messaging Token and Sender ID to your Pushwoosh Control Panel. [block:image] { "images": [ { "image": [ "https://files.readme.io/ba80fbd-step-6.png", "step-6.png", 895, 540, "#e7e7ef" ] } ] } [/block] [block:callout] { "type": "warning", "body": "Check that the Google Project Number (GCM Sender ID) in your **[AndroidManifest.xml](http://docs.pushwoosh.com/docs/android-sdk-fragments#writing-code)** file matches the one in your Firebase Console.", "title": "Important" } [/block] **5.** Here’s the API key you will need to configure your application in Pushwoosh Control Panel. Go to the Pushwoosh Control Panel **6.** In your application click on **Android->Edit** to change the configuration for Android application. **7.** Copy your **Firebase Cloud Messaging Token** to the **API Key**. **8.** Copy your **Sender ID** to the **GCM Sender ID** field. [block:callout] { "type": "success", "title": "GCM Sender ID", "body": "**GCM Sender ID** is a unique numerical value created when you configure your Google project (given as **Project Number** in the Google Developers Console and as **Sender ID** in the Firebase console). In order to locate your Project Number please go to [**Android FAQ**](http://docs.pushwoosh.com/docs/android-faq#how-to-locate-my-google-project-number)" } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/2b8b7cf-step-7.png", "step-7.png", 595, 419, "#0ca4ec" ] } ] } [/block] That’s it! Easy, isn’t it? [block:callout] { "type": "danger", "title": "MismatchSenderID error", "body": "If you see “MismatchSenderID” errors in your Push History, please try the following:\n\n* Check that the Google Project Number in your app matches the one in your Google Developers Console.\n\n* Firebase is deprecating Server Keys and replacing them with Firebase Cloud Messaging Tokens, and occasionally Server Keys may just stop working. If you still use Server Key as the API key when configuring your Pushwoosh Android app and get the MismatchSenderID error, please make sure to use **Firebase Cloud Messaging Token** instead of the **Server Key**." } [/block]