{"__v":55,"_id":"55acf3cd18eefd0d0071d5fb","category":{"__v":15,"_id":"5540e5f131827a0d007ab212","pages":["5540e66b31827a0d007ab217","5540e67731827a0d007ab219","55ac917b5863b817008ae3b4","55acaa4c6b4ff90d00784a92","55acb96418eefd0d0071d553","55acc8aa18eefd0d0071d596","55accd2818eefd0d0071d5a8","55acd06518eefd0d0071d5b6","55acddd7fb7b3c19003739cc","55ace14bfb7b3c19003739d3","55ace3a9fb7b3c19003739d7","55acea24f93f0c0d005b880f","55acf15bf93f0c0d005b8821","55acf3cd18eefd0d0071d5fb","55d1f1c0486de50d00326f17"],"project":"5540ce1b31827a0d007ab1cc","version":"5540ce1c31827a0d007ab1cf","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-04-29T14:08:49.271Z","from_sync":false,"order":4,"slug":"android","title":"Android"},"parentDoc":null,"project":"5540ce1b31827a0d007ab1cc","user":"55a79a4d4a33f92b00b7a111","version":{"__v":31,"_id":"5540ce1c31827a0d007ab1cf","project":"5540ce1b31827a0d007ab1cc","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"},"updates":["583ea8833a4a941900c5459a"],"next":{"pages":[],"description":""},"createdAt":"2015-07-20T13:12:45.720Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":5,"body":"* [What does Android push token and HWID look like?](http://docs.pushwoosh.com/docs/android-faq#what-does-android-push-token-and-hwid-look-like)\n* [How can I obtain my Android device push token?](http://docs.pushwoosh.com/docs/android-faq#how-can-i-obtain-my-android-device-push-token)\n* [How do I find my Google Project Number?](http://docs.pushwoosh.com/docs/android-faq#how-to-locate-my-google-project-number)\n* [What permissions are necessary and what are optional?](http://docs.pushwoosh.com/docs/android-faq#what-permissions-are-necessary-and-what-are-option)\n* [How accurate is the total number of Android subscribers?](http://docs.pushwoosh.com/docs/android-faq#how-accurate-is-the-total-number-of-android-subscr)\n* [Can I use HTML tags in pushes sent to Android?](http://docs.pushwoosh.com/docs/android-faq#can-i-use-html-tags-in-pushes-sent-to-android)\n* [How do I set a notification icon in Android Lollipop (and later versions)?](http://docs.pushwoosh.com/docs/android-faq#how-to-set-a-notification-icon-in-android-lollipop)\n* [Can I use two GcmListenerService's?](http://docs.pushwoosh.com/docs/android-faq#can-i-use-two-gcmlistenerservices)\n* [Can I use old GcmBroadcastReceiver with the new GcmReceiver?](http://docs.pushwoosh.com/docs/android-faq#can-i-use-old-gcmbroadcastreceiver-with-the-new-gc)\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"What does Android push token and HWID look like?\"\n}\n[/block]\nAndroid device push tokens can differ in length (usually below 255 characters), and usually start with **APA**… Push token example:\n```\nAPA91bFoi3lMMre9G3XzR1LrF4ZT82_15MsMdEICogXSLB8-MrdkRuRQFwNI5u8Dh0cI90ABD3BOKnxkEla8cGdisbDHl5cVIkZah5QUhSAxzx4Roa7b4xy9tvx9iNSYw-eXBYYd8k1XKf8Q_Qq1X9-x-U-Y79vdPq\n```\nUsing raw device tokens for targeting specific devices is not the most reliable way because *GCM push tokens tend to change from time to time,* and it’s hard to tell how often it occurs. Therefore, we strongly recommend using **Tags** to send pushes to specific devices. HWID example:\n\n`a9f282012f5dce9e`\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"How can I obtain my Android device push token?\"\n}\n[/block]\nYou can obtain your Android device push token in the console log. Use the logcat tool in [Android Studio](http://developer.android.com/sdk/index.html#download).\n\nOpen **ddms.bat**  in `C:\\Users\\%Username%\\AppData\\Local\\Android\\sdk\\tools\\ddms.bat`, connect your device to PC and allow USB debugging in Android settings. Run your application on the device. Locate `/registerDevice`, find the push token for your device to use in Test Devices later on.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/XPJBvHaLQXqEDDuqQ5w1_Android_Studio_Logcat-1024x443.png\",\n        \"Android_Studio_Logcat-1024x443.png\",\n        \"1024\",\n        \"443\",\n        \"#558aa9\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nNote that you can simply launch this file from its location without launching the Android Studio itself.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"How do I find my Google Project Number?\"\n}\n[/block]\n**Project Number** is automatically assigned by [**Google API Console**](https://console.developers.google.com) when you create a project. You can find the **Project Number** in “IAM & Admin” tab of Google API console.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/f1920b3-27701da-step-1.png\",\n        \"27701da-step-1.png\",\n        319,\n        284,\n        \"#ebe5e7\"\n      ]\n    }\n  ]\n}\n[/block]\nThen go to **Settings** tab and here it is, your **Project Number**.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/547e0ff-69dde8d-step-2.png\",\n        \"69dde8d-step-2.png\",\n        559,\n        442,\n        \"#f6f7f9\"\n      ]\n    }\n  ]\n}\n[/block]\nHere, **852741519435** is the **Project Number** you enter in the app. *Don’t confuse it with Project ID, which is a completely different identifier & is **used only within Google Developers Console!***\nEven though GCM Project Number is a number, make sure you prefix it with the letter “A” when integrating the following Android SDKs into your project: Native, Unity, Marmalade, Adobe AIR and Xamarin.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"What permissions are necessary and what are optional?\"\n}\n[/block]\nWhen installed on an Android device, the application will ask for the following permissions in connection with Pushwoosh SDK:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<!-- GCM connects to Google Services. -->\\n <uses-permission android:name=\\\"android.permission.INTERNET\\\"/>\\n  \\n <!-- GCM requires a Google account to use push notifications. -->\\n <uses-permission android:name=\\\"android.permission.GET_ACCOUNTS\\\"/>\\n \\n <!-- Permission to get device hwid. This permission is optional, if not used, the random hwid is generated -->\\n <uses-permission android:name=\\\"android.permission.READ_PHONE_STATE\\\"/>\\n \\n <!-- Keeps the processor from sleeping when a message is received. -->\\n <uses-permission android:name=\\\"android.permission.WAKE_LOCK\\\"/>\\n \\n <!-- This permission is required for geolocation pushes, and is used to determine whether the device can access the network. -->\\n <uses-permission android:name=\\\"android.permission.ACCESS_NETWORK_STATE\\\"/>\\n \\n <!-- Prevents other applications from registering and receiving the application's messages. -->\\n <uses-permission android:name=\\\"${applicationId}.permission.C2D_MESSAGE\\\"/>\\n \\n <!-- This app has permission to register and receive data message. -->\\n <uses-permission android:name=\\\"com.google.android.c2dm.permission.RECEIVE\\\"/>\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\nOur SDK doesn’t ask for permission to access images, device contacts, etc.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"**READ_PHONE_STATE** permission: SDK uses this permission to get DeviceId property of the device if ANDROID_ID is not available. You can omit this permission in your APK. However if ANDROID_ID is unavailable, features like AppGroups or cross-application user targeting will not work for this device.\\n\\n**GET_ACCOUNTS** permission: GCM requires a Google account if you target Androids lower than 4.0.4\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"How accurate is the total number of Android subscribers?\"\n}\n[/block]\nPushwoosh clears unsubscribed Android devices from the database upon receiving the “NotRegistered” response from GCM, which can be returned after the second attempt to reach a specific device. It means that you have to send 2 pushes to an unsubscribed device to have it removed from our database. \nHere’s the most common scenario described in the [GCM documentation](http://developer.android.com/google/gcm/gcm.html):\n\n1. Your subscriber uninstalls the app.\n2. Pushwoosh sends a message to GCM server.\n3. The GCM server sends the message to your user’s device.\n4. The GCM client on the device receives the message and detects that your application has  been uninstalled; the detection details depend on the platform on which the app is running.\n5. The GCM client on the device informs the GCM server that the app was uninstalled.\n6. The GCM server marks the registration ID for deletion.\n7. Pushwoosh sends another message to GCM.\n8. The GCM returns a NotRegistered message.\n9. Pushwoosh removes the push token from your userbase.\n\nIt might take a while for registration ID to be completely removed from GCM. Thus it is possible a  message sent in step 7 above gets a valid message ID as response, even though the message will not be delivered to the client app.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Can I use HTML tags in pushes sent to Android?\"\n}\n[/block]\nYes, in Android you may use the following HTML tags in order to modify the appearance of a push:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<span style=\\\"color: green;\\\"><b><i><span style=\\\"text-decoration: underline;\\\">Hello world!\\nHello hi hey</span></i></b></span>\",\n      \"language\": \"html\"\n    }\n  ]\n}\n[/block]\nPlace these HTML tags in the **Message** input field, and use them in the API request as well. Note that some Android devices may fail to process these HTML tags properly, but most of the devices we have used for tests displayed formatting properly.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"How to set a notification icon in Android Lollipop (and later versions)?\"\n}\n[/block]\nIn Android Lollipop icons were changed to be white only. Therefore, if you select **targetSdkVersion >= 21** in your **AndroidManifest.xml** file, Android will only use alpha-channel of the icon. \nSee more on the behavior in [Android documentation](https://developer.android.com/about/versions/android-5.0-changes.html#BehaviorNotifications).\n\nThe system ignores all non-alpha channels in action icons and in the main notification icon. Assume these icons will be alpha-only. The system draws notification icons in white and action icons in dark gray. *This is beyond Pushwoosh SDK control*.\n\nHowever, you can revert this behavior to use old style colored icons:\n**1.** Set targetSdkVersion to **19**. This automatically brings back the old behavior.\n\n**OR** \n\n**2.** Create the notification icon according to the [Android guidelines](http://developer.android.com/design/style/iconography.html#notification). As per [documentation](https://developer.android.com/about/versions/android-5.0-changes.html#BehaviorNotifications), the system will ignore all the colors. \n**2.1.** Name the icon as **pw_notification.png** and put it in **res/drawable** folder. Pushwoosh SDK will use this icon as default for notifications. \n**2.2.** Alternatively, you can use Remote API and set the `\"android_icon\"` parameter value to the icon image (without file extension).\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Can I use two GcmListenerService's?\"\n}\n[/block]\nYes you can. Sometimes you need to use Pushwoosh SDK with another SDK that uses GCM as well. Usually one runs into the following problem: **GcmReceiver** launches only **one** service, as a result only one subclassed service will receive push notifications and events. This would be either the one which appears the first in **AndroidManifest.xml** or the one with the higher priority (as outlined here: https://developer.android.com/guide/topics/manifest/intent-filter-element.html)\n\nTo solve this problem create master GcmListenerService and proxy events to other srvices. See the example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"public class GCMListenerRouterService extends GcmListenerService {\\n    private void dispatchMessage(String component, Bundle data) {\\n        Intent intent = new Intent();\\n        intent.putExtras(data);\\n        intent.setAction(\\\"com.google.android.c2dm.intent.RECEIVE\\\");\\n        intent.setComponent(new ComponentName(getPackageName(), component));\\n  \\n        GcmReceiver.startWakefulService(getApplicationContext(), intent);\\n    }\\n  \\n    :::at:::Override\\n    public void onMessageReceived(String from, Bundle data) {\\n        Log.i(\\\"PushwooshTest\\\", \\\"Gcm router service received message: \\\" + (data != null ? data.toString() : \\\"<null>\\\") + \\\" from: \\\" + from);\\n  \\n        // Base GCM listener service removes this extra before calling onMessageReceived\\n        // Need to set it again to pass intent to another service\\n        data.putString(\\\"from\\\", from);\\n  \\n        if (TextUtils.equals(from, getString(R.string.PW_PRIVATE_PROJECT_ID))) {\\n            dispatchMessage(GCMListenerService.class.getName(), data);\\n        }\\n        else if (TextUtils.equals(from, getString(R.string.PW_DEMO_PROJECT_ID))) {\\n            dispatchMessage(AnotherGCMListenerService.class.getName(), data);\\n        }\\n    }\\n}\",\n      \"language\": \"java\",\n      \"name\": \"GCMListenerRouterService.java\"\n    }\n  ]\n}\n[/block]\nRegister this receiver with the highest priority:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<service\\n    android:name=\\\".GCMListenerRouterService\\\"\\n    android:enabled=\\\"true\\\"\\n    android:exported=\\\"false\\\" >\\n    <intent-filter android:priority=\\\"100\\\" >\\n        <action android:name=\\\"com.google.android.c2dm.intent.RECEIVE\\\" />\\n    </intent-filter>\\n</service>\",\n      \"language\": \"xml\",\n      \"name\": \"AndroidManifest.xml\"\n    }\n  ]\n}\n[/block]\nDo the same for **InstanceIdListenerService** to listen correctly for the push token changes. We'll leave this for homework. :)\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Can I use old GcmBroadcastReceiver with the new GcmReceiver?\"\n}\n[/block]\nYes you can and this works out of the box. **GcmReceiver** and **GcmBroadcastReceiver** - are broadcast receivers and both will receive all messages.","excerpt":"","slug":"android-faq","type":"basic","title":"Android FAQ"}
* [What does Android push token and HWID look like?](http://docs.pushwoosh.com/docs/android-faq#what-does-android-push-token-and-hwid-look-like) * [How can I obtain my Android device push token?](http://docs.pushwoosh.com/docs/android-faq#how-can-i-obtain-my-android-device-push-token) * [How do I find my Google Project Number?](http://docs.pushwoosh.com/docs/android-faq#how-to-locate-my-google-project-number) * [What permissions are necessary and what are optional?](http://docs.pushwoosh.com/docs/android-faq#what-permissions-are-necessary-and-what-are-option) * [How accurate is the total number of Android subscribers?](http://docs.pushwoosh.com/docs/android-faq#how-accurate-is-the-total-number-of-android-subscr) * [Can I use HTML tags in pushes sent to Android?](http://docs.pushwoosh.com/docs/android-faq#can-i-use-html-tags-in-pushes-sent-to-android) * [How do I set a notification icon in Android Lollipop (and later versions)?](http://docs.pushwoosh.com/docs/android-faq#how-to-set-a-notification-icon-in-android-lollipop) * [Can I use two GcmListenerService's?](http://docs.pushwoosh.com/docs/android-faq#can-i-use-two-gcmlistenerservices) * [Can I use old GcmBroadcastReceiver with the new GcmReceiver?](http://docs.pushwoosh.com/docs/android-faq#can-i-use-old-gcmbroadcastreceiver-with-the-new-gc) [block:api-header] { "type": "basic", "title": "What does Android push token and HWID look like?" } [/block] Android device push tokens can differ in length (usually below 255 characters), and usually start with **APA**… Push token example: ``` APA91bFoi3lMMre9G3XzR1LrF4ZT82_15MsMdEICogXSLB8-MrdkRuRQFwNI5u8Dh0cI90ABD3BOKnxkEla8cGdisbDHl5cVIkZah5QUhSAxzx4Roa7b4xy9tvx9iNSYw-eXBYYd8k1XKf8Q_Qq1X9-x-U-Y79vdPq ``` Using raw device tokens for targeting specific devices is not the most reliable way because *GCM push tokens tend to change from time to time,* and it’s hard to tell how often it occurs. Therefore, we strongly recommend using **Tags** to send pushes to specific devices. HWID example: `a9f282012f5dce9e` [block:api-header] { "type": "basic", "title": "How can I obtain my Android device push token?" } [/block] You can obtain your Android device push token in the console log. Use the logcat tool in [Android Studio](http://developer.android.com/sdk/index.html#download). Open **ddms.bat** in `C:\Users\%Username%\AppData\Local\Android\sdk\tools\ddms.bat`, connect your device to PC and allow USB debugging in Android settings. Run your application on the device. Locate `/registerDevice`, find the push token for your device to use in Test Devices later on. [block:image] { "images": [ { "image": [ "https://files.readme.io/XPJBvHaLQXqEDDuqQ5w1_Android_Studio_Logcat-1024x443.png", "Android_Studio_Logcat-1024x443.png", "1024", "443", "#558aa9", "" ] } ] } [/block] Note that you can simply launch this file from its location without launching the Android Studio itself. [block:api-header] { "type": "basic", "title": "How do I find my Google Project Number?" } [/block] **Project Number** is automatically assigned by [**Google API Console**](https://console.developers.google.com) when you create a project. You can find the **Project Number** in “IAM & Admin” tab of Google API console. [block:image] { "images": [ { "image": [ "https://files.readme.io/f1920b3-27701da-step-1.png", "27701da-step-1.png", 319, 284, "#ebe5e7" ] } ] } [/block] Then go to **Settings** tab and here it is, your **Project Number**. [block:image] { "images": [ { "image": [ "https://files.readme.io/547e0ff-69dde8d-step-2.png", "69dde8d-step-2.png", 559, 442, "#f6f7f9" ] } ] } [/block] Here, **852741519435** is the **Project Number** you enter in the app. *Don’t confuse it with Project ID, which is a completely different identifier & is **used only within Google Developers Console!*** Even though GCM Project Number is a number, make sure you prefix it with the letter “A” when integrating the following Android SDKs into your project: Native, Unity, Marmalade, Adobe AIR and Xamarin. [block:api-header] { "type": "basic", "title": "What permissions are necessary and what are optional?" } [/block] When installed on an Android device, the application will ask for the following permissions in connection with Pushwoosh SDK: [block:code] { "codes": [ { "code": "<!-- GCM connects to Google Services. -->\n <uses-permission android:name=\"android.permission.INTERNET\"/>\n \n <!-- GCM requires a Google account to use push notifications. -->\n <uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>\n \n <!-- Permission to get device hwid. This permission is optional, if not used, the random hwid is generated -->\n <uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>\n \n <!-- Keeps the processor from sleeping when a message is received. -->\n <uses-permission android:name=\"android.permission.WAKE_LOCK\"/>\n \n <!-- This permission is required for geolocation pushes, and is used to determine whether the device can access the network. -->\n <uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>\n \n <!-- Prevents other applications from registering and receiving the application's messages. -->\n <uses-permission android:name=\"${applicationId}.permission.C2D_MESSAGE\"/>\n \n <!-- This app has permission to register and receive data message. -->\n <uses-permission android:name=\"com.google.android.c2dm.permission.RECEIVE\"/>", "language": "java" } ] } [/block] Our SDK doesn’t ask for permission to access images, device contacts, etc. [block:callout] { "type": "info", "body": "**READ_PHONE_STATE** permission: SDK uses this permission to get DeviceId property of the device if ANDROID_ID is not available. You can omit this permission in your APK. However if ANDROID_ID is unavailable, features like AppGroups or cross-application user targeting will not work for this device.\n\n**GET_ACCOUNTS** permission: GCM requires a Google account if you target Androids lower than 4.0.4" } [/block] [block:api-header] { "type": "basic", "title": "How accurate is the total number of Android subscribers?" } [/block] Pushwoosh clears unsubscribed Android devices from the database upon receiving the “NotRegistered” response from GCM, which can be returned after the second attempt to reach a specific device. It means that you have to send 2 pushes to an unsubscribed device to have it removed from our database. Here’s the most common scenario described in the [GCM documentation](http://developer.android.com/google/gcm/gcm.html): 1. Your subscriber uninstalls the app. 2. Pushwoosh sends a message to GCM server. 3. The GCM server sends the message to your user’s device. 4. The GCM client on the device receives the message and detects that your application has been uninstalled; the detection details depend on the platform on which the app is running. 5. The GCM client on the device informs the GCM server that the app was uninstalled. 6. The GCM server marks the registration ID for deletion. 7. Pushwoosh sends another message to GCM. 8. The GCM returns a NotRegistered message. 9. Pushwoosh removes the push token from your userbase. It might take a while for registration ID to be completely removed from GCM. Thus it is possible a message sent in step 7 above gets a valid message ID as response, even though the message will not be delivered to the client app. [block:api-header] { "type": "basic", "title": "Can I use HTML tags in pushes sent to Android?" } [/block] Yes, in Android you may use the following HTML tags in order to modify the appearance of a push: [block:code] { "codes": [ { "code": "<span style=\"color: green;\"><b><i><span style=\"text-decoration: underline;\">Hello world!\nHello hi hey</span></i></b></span>", "language": "html" } ] } [/block] Place these HTML tags in the **Message** input field, and use them in the API request as well. Note that some Android devices may fail to process these HTML tags properly, but most of the devices we have used for tests displayed formatting properly. [block:api-header] { "type": "basic", "title": "How to set a notification icon in Android Lollipop (and later versions)?" } [/block] In Android Lollipop icons were changed to be white only. Therefore, if you select **targetSdkVersion >= 21** in your **AndroidManifest.xml** file, Android will only use alpha-channel of the icon. See more on the behavior in [Android documentation](https://developer.android.com/about/versions/android-5.0-changes.html#BehaviorNotifications). The system ignores all non-alpha channels in action icons and in the main notification icon. Assume these icons will be alpha-only. The system draws notification icons in white and action icons in dark gray. *This is beyond Pushwoosh SDK control*. However, you can revert this behavior to use old style colored icons: **1.** Set targetSdkVersion to **19**. This automatically brings back the old behavior. **OR** **2.** Create the notification icon according to the [Android guidelines](http://developer.android.com/design/style/iconography.html#notification). As per [documentation](https://developer.android.com/about/versions/android-5.0-changes.html#BehaviorNotifications), the system will ignore all the colors. **2.1.** Name the icon as **pw_notification.png** and put it in **res/drawable** folder. Pushwoosh SDK will use this icon as default for notifications. **2.2.** Alternatively, you can use Remote API and set the `"android_icon"` parameter value to the icon image (without file extension). [block:api-header] { "type": "basic", "title": "Can I use two GcmListenerService's?" } [/block] Yes you can. Sometimes you need to use Pushwoosh SDK with another SDK that uses GCM as well. Usually one runs into the following problem: **GcmReceiver** launches only **one** service, as a result only one subclassed service will receive push notifications and events. This would be either the one which appears the first in **AndroidManifest.xml** or the one with the higher priority (as outlined here: https://developer.android.com/guide/topics/manifest/intent-filter-element.html) To solve this problem create master GcmListenerService and proxy events to other srvices. See the example: [block:code] { "codes": [ { "code": "public class GCMListenerRouterService extends GcmListenerService {\n private void dispatchMessage(String component, Bundle data) {\n Intent intent = new Intent();\n intent.putExtras(data);\n intent.setAction(\"com.google.android.c2dm.intent.RECEIVE\");\n intent.setComponent(new ComponentName(getPackageName(), component));\n \n GcmReceiver.startWakefulService(getApplicationContext(), intent);\n }\n \n @Override\n public void onMessageReceived(String from, Bundle data) {\n Log.i(\"PushwooshTest\", \"Gcm router service received message: \" + (data != null ? data.toString() : \"<null>\") + \" from: \" + from);\n \n // Base GCM listener service removes this extra before calling onMessageReceived\n // Need to set it again to pass intent to another service\n data.putString(\"from\", from);\n \n if (TextUtils.equals(from, getString(R.string.PW_PRIVATE_PROJECT_ID))) {\n dispatchMessage(GCMListenerService.class.getName(), data);\n }\n else if (TextUtils.equals(from, getString(R.string.PW_DEMO_PROJECT_ID))) {\n dispatchMessage(AnotherGCMListenerService.class.getName(), data);\n }\n }\n}", "language": "java", "name": "GCMListenerRouterService.java" } ] } [/block] Register this receiver with the highest priority: [block:code] { "codes": [ { "code": "<service\n android:name=\".GCMListenerRouterService\"\n android:enabled=\"true\"\n android:exported=\"false\" >\n <intent-filter android:priority=\"100\" >\n <action android:name=\"com.google.android.c2dm.intent.RECEIVE\" />\n </intent-filter>\n</service>", "language": "xml", "name": "AndroidManifest.xml" } ] } [/block] Do the same for **InstanceIdListenerService** to listen correctly for the push token changes. We'll leave this for homework. :) [block:api-header] { "type": "basic", "title": "Can I use old GcmBroadcastReceiver with the new GcmReceiver?" } [/block] Yes you can and this works out of the box. **GcmReceiver** and **GcmBroadcastReceiver** - are broadcast receivers and both will receive all messages.