• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by Klvana · Feb 26, 2015 at 11:54 AM · androidiconnotification

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

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image haddad · Mar 13, 2015 at 06:24 PM 0
Share

Did you solve this by any chance?

avatar image Klvana · Mar 26, 2015 at 01:00 PM 0
Share

unfortunately not :(

8 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by ro_ro · Apr 15, 2016 at 08:02 AM

Post android Lollipop release android has changed the guidelines for displaying notification icons in the Notification bar. The official documentation says "Update or remove assets that involve color. The system ignores all non-alpha channels in action icons and in the main notification icon. You should assume that these icons will be alpha-only. The system draws notification icons in white and action icons in dark gray.” Now what that means in lay man terms is "Convert all parts of the image that you don’t want to show to transparent pixels. All colors and non transparent pixels are displayed in white"

You can see how to do this in detail with screenshots here https://blog.clevertap.com/fixing-notification-icon-for-android-lollipop-and-above/

Hope that helps

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by MGGDev · Jan 09, 2019 at 11:08 AM

This worked for me:

So you should be able to add your icon(s) to Assets/Plugins/Android/res/drawable/ and reference it name

Then, in the notification json, specify your icon. For example:

 "notification": {
         "title": "Title",
         "body" : "First Notification",
         "text" : "Text",
         "icon" : "MyIcon"
     }

Note: I used one of these icons.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by KaveeM2007 · May 21 at 07:19 AM

How I solved it - Open an image editing software (Photoshop) and erase the things that you don't want in the icon ( this means the background , logos and other unwanted things). The reason is, small icon of android notifications in the mobile notification settings of Unity can only be shown by using alpha channels. further more, the parts of the image or texture which aren't transparent will be seen and the parts which are transparent wont be seen. So, you might understand that this will be a black&white icon. When you are editing in the image editing software, leave everything that you need to be scene, their color doesn't matter cuz at the end they will be just white.

If you want a background, try changing the alpha values of the background and the icon( the particular shape which is considered as the icon , ex - A sword as the icon and a background for it) if you make the background's alpha values less, it will become a bit transparent than the icon(sword in my example), if you do the opposite, let's say you deceased the icon's alpha value, and increased the background, the opposite would happen. [ I didn't practically check this but according to my knowledge this should work)

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
  • ‹
  • 1
  • 2

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

12 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

OpenFeint app name/icon problem 2 Answers

App icon problem on android 5 Answers

[Android, GCM] How to display notification when receiving the message from our server? 3 Answers

Unity Android Send Notification after Application Quit 1 Answer

Android Notification in a Plugin 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges