Pushwoosh / pushwoosh-phonegap-plugin

Pushwoosh PhoneGap Build Plugin
Other
110 stars 139 forks source link

notification icon shows white in android. #258

Closed mobileias closed 6 years ago

mobileias commented 7 years ago

Hello

After using <preference name="phonegap-version" value="cli-7.0.1" />

We are not able to see notification icon in android.

like see

image

wfhm commented 7 years ago

Hi,

If you set targetSdkVersion >= 21 on Android Lollipop and higher devices, the system will use only an alpha-channel of your icon. See more 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.

Therefore, you should create a notification icon according to material design guidelines:

https://material.io/guidelines/style/icons.html#notification

You can use the following tool to generate and preview a notification icon:

https://romannurik.github.io/AndroidAssetStudio/icons-notification.html#source.type=clipart&source.clipart=ac_unit&source.space.trim=1&source.space.pad=0&name=ic_stat_ac_unit

mobileias commented 7 years ago

ok thanks for reply.

but if we use https://material.io/guidelines/style/icons.html#notification type icons then it not works fine in android 6.0 as we checked. Any solutions ? Thanks in advance Regards

wfhm commented 7 years ago

@mobileias could you please specify what exactly is not working fine? How does your icon appear on Android 6.0 devices? Did you try it with other Android versions (Lollipop, Nougat)? Also, could you please share a link to your new icon that was created according to this guide?

mobileias commented 7 years ago

i have one device in which android 6.0.1 . and for that device push icon shows fine. but other same android version device with Samsung manufacture company . and that device shows white icon .

i have question sir like if we set default notification icon like

so is it take push notification icon as default for all android device ?

jezbo7 commented 7 years ago

"The system ignores all non-alpha channels in action icons and in the main notification icon." What does this actually mean? Are colour notification icons supported, or are they always shown in gray & white?

wfhm commented 7 years ago

@mobileias

If you set a default notification icon it should appear in the same manner on all Android devices.

Could you please specify which particular device is still showing the icon incorrectly? Also, could you please share your icon so we could test it on our side?

wfhm commented 7 years ago

@jezbo7

Android icon on Android 5+ consists of two parts: a big custom icon and a small default notification icon. The latter will always appear gray&white. If you do not set a large icon, the small one will be used instead. Action icon in status bar also appears white.

You can set a large icon remotely by adding "android_custom_icon":"URL_path_to_your_icon" to a push payload. Small icon is a default notification icon, however can also be set with "android_icon" key in payload. "android_icon" can only use icons from your application bundle.