Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android notification icon #4

Open
lpointet opened this issue May 23, 2016 · 5 comments
Open

Android notification icon #4

lpointet opened this issue May 23, 2016 · 5 comments
Labels

Comments

@lpointet
Copy link
Collaborator

Android notification center doesn't show the app icon, but a white square. It may be related to "alpha transparency" image needed by Android new versions, or maybe we only need to reference a specific icon into config.xml file.

@lpointet lpointet added the bug label May 23, 2016
@blupu
Copy link
Collaborator

blupu commented May 26, 2016

@lpointet I believe there's a way to solve the problem here: phonegap/build#472.

If I am correct:

  • We have to provide a specific icon for status bar notification icon
  • This icon should be white with alpha transparency (@todo find the Android spec about that)
  • This icon has to be stored in the res/drawables folder
  • It also has to be referenced in the JS itself (?)
  • The problem with PhoneGap Build is that you don't have access to the res/drawables folder (only www)
  • However, it seems that since nov 2015, there is a way to copy things outside the www folder

For the record:

@lpointet
Copy link
Collaborator Author

AFAIK, Android spec is here: https://www.google.com/design/spec/style/icons.html#notification

@blupu
Copy link
Collaborator

blupu commented May 26, 2016

There, a more digestible icon reference: http://iconhandbook.co.uk/reference/chart/android/

@blupu
Copy link
Collaborator

blupu commented Jul 11, 2016

@blupu
Copy link
Collaborator

blupu commented Jan 28, 2017

To solve the issue:

A good start about Android's notification icons can be found here: https://developer.android.com/guide/practices/ui_guidelines/icon_design_status_bar.html

Create a specific icon

  • Android 4+ needs a specific icon for notifications
  • It is used for notifications on lock screen (inside a colored circle) and in status bar
  • This specific icon has to be white on transparent background
  • It must be a 32bit PNG file
  • It is necessary to provide an icon for each screen density (ldpi, mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi)
  • a thin margin around the icon is a good practice

Sizes for various screen densities can be found here: http://iconhandbook.co.uk/reference/chart/android/

Add notification icons to your PGB project

  • Notifications icons are stored in res/drawable folders (one per density)
  • To have PGB copy the notification icons in the proper folders, icons has to be placed in the /locales/android/ folder
  • eg. /locales/android/drawable-hdpi content will be copied to res/drawable-hdpi folder at compilation time

Great information about PhoneGap Build support for Android notification icons can be found here:

PushWoosh

  • To have PushWoosh use your Android notification icon, you have to name the notification files pw_notification.png (ie. all files will have the same name but are stored in density folders)
  • You can set the accent color of the circle used in locked screen notification message in the PushWoosh Send Message online interface: the field is called Image Background Color

More information about PushWoosh support of Android notification icons can be found here: http://docs.pushwoosh.com/docs/android-faq

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants