- Home /
White notification icon - Android 5.0 Lollipop
Hello, when android:targetSdkVersion is set to higher version than 20,a white box notification icon is displayed in the status bar, instead of the real colored app icon. Android 5.0 allows only white notification icons in the status bar, according to this:
http://www.reddit.com/r/androiddev/comments/2nz0bt/my_app_notification_has_weird_icon_on_android/ http://developer.android.com/design/patterns/notifications.html
It is possible to set the notification icon in Unity editor somehow? What if we want to use white notification icon for SdkVersion > 20 and another colored notification icon for SdkVersion <= 20?
Thank you for help
Answer by Bilelmnasser · Feb 19, 2016 at 09:38 AM
//add this line to your android manifest file : i have tested this !!
<!-- GCM requires Android SDK version 2.2 (API level 8) or above. -->
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="16" />
Answer by cdes · Mar 27, 2015 at 04:43 PM
We're using a plugin called ELAN. It lets you use an icon different from the app icon which will be used for the notification.
Here's the plugin: https://www.assetstore.unity3d.com/#!/content/9484
The trick is to use this to generate your notification icon: http://romannurik.github.io/AndroidAssetStudio/icons-notification.html
The drawable folders should be inside this folder: (Assets/Plugins/Android/res/)
Answer by Voxel-Busters · Jun 04, 2015 at 12:07 PM
Basically you need to setSmallIcon of notification builder to the required bitmap.
Just to let you know, We recently released Cross Platform Native Plugins
This handles coloured and white icons according to the target platform.
If you can let me know which plugin you are using probably I can guide you better.
Answer by funx · Jun 26, 2015 at 02:11 AM
I haven't tested it myself but I heard if you set the targetSdk < lollipop then it'll work:
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="19" />
Answer by Yuriy-Ivanov · Oct 15, 2015 at 01:11 AM
Hi @Klvana,
What if we want to use white notification icon for SdkVersion > 20 and another colored notification icon for SdkVersion <= 20?
This is gracefully solved in our plugin UTNotifications. It provides you two options: enabling Android 4.4 Compatibility Mode (which sets targetSdkVersion to 19) or set separate notification icons for Android 5.0+ and lesser versions of Android. It also contains solutions for other Android (and not only) related issues, f.e. restores scheduled notifications after a device reboot, which is not supported by Android directly.
Your answer
Follow this Question
Related Questions
Application doesn't respond after pressing home. 0 Answers
Audio Playing even when the app is closed 2 Answers
Android pin push notifications 1 Answer
Run a script in background when the app is open or closed 5 Answers
send a sms to myself in unity 0 Answers