Giter Club home page Giter Club logo

Comments (24)

michael-may avatar michael-may commented on July 20, 2024 9

+1

Tested the TargetSDK workaround and it brings the full icon back for now at least.

In your config.xml:

<platform name="android">
   ...
   <preference name="android-targetSdkVersion" value="19"/>
</platform>

from phonegap-plugin-push.

rohit121 avatar rohit121 commented on July 20, 2024 1

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

from phonegap-plugin-push.

macdonst avatar macdonst commented on July 20, 2024

@sebrojas14 upon having the chance to look into this bug I believe it not to be a bug. In Android Lollipop there were changes to the notifications so all icons show up as white. See the following url: https://developer.android.com/design/patterns/notifications.html

I think the best way forward for you is to add a transparency to your icon so that it your icon shows up as a silhouette of a person. Potentially we need to add another icon into cordova/phonegap.

from phonegap-plugin-push.

quedicesebas avatar quedicesebas commented on July 20, 2024

Yes, you're right. But I need the app icon to have a white background. So, you would be nice a a way to specify a different icon for notifications, or even better, the option of use icons with badge like skype and inbox in the image

from phonegap-plugin-push.

macdonst avatar macdonst commented on July 20, 2024

@sebrojas14 so the way that it works on Android is you can specify a small icon and large icon in the notification. As you can see in this screen shot:

Screenshot

You can see the PhoneGap Enterprise is the large icon and the cordova build bot is the small icon. I can add in the large icon support but we don't have a good way of specifying it right now. I'm changing this to an enhancement for now.

from phonegap-plugin-push.

quedicesebas avatar quedicesebas commented on July 20, 2024

So for now, is not possible to specify a different icon for the notifications?

from phonegap-plugin-push.

macdonst avatar macdonst commented on July 20, 2024

@sebrojas14 no, not at the moment but my plan is to add a option in the android setup to provide an icon to use instead of the main app icon. If not icon is provide it will use the main app icon as a fallback.

from phonegap-plugin-push.

quedicesebas avatar quedicesebas commented on July 20, 2024

I'll wait for it! thank you

from phonegap-plugin-push.

ivanmayes avatar ivanmayes commented on July 20, 2024

+1 this would be extremely helpful, white square are no fun!

from phonegap-plugin-push.

ashconnell avatar ashconnell commented on July 20, 2024

+1 Waiting for this also, we switched to this plugin because the PushPlugin repo is insanely outdated.

from phonegap-plugin-push.

ashconnell avatar ashconnell commented on July 20, 2024

@michael-may The target SDK workaround is not a very graceful fix.

from phonegap-plugin-push.

macdonst avatar macdonst commented on July 20, 2024

This is coming tonight or tomorrow. I just need to document it:

Large icon support
supports url, asset or drawable

Small icon support
Set the drawable via the Android options. Defaults to app icon if nothing is passed in. As well, you can set the background color for the icon.

New hotness

from phonegap-plugin-push.

quedicesebas avatar quedicesebas commented on July 20, 2024

Nice! And what is the icon used in the notification bar?

from phonegap-plugin-push.

macdonst avatar macdonst commented on July 20, 2024

@sebrojas14 the small icon, specified at init time.

from phonegap-plugin-push.

macdonst avatar macdonst commented on July 20, 2024

2015-07-24 02 17 55
2015-07-24 02 20 02
2015-07-24 02 34 41
2015-07-24 02 46 58
2015-07-24 02 52 00

from phonegap-plugin-push.

quedicesebas avatar quedicesebas commented on July 20, 2024

Sorry, I was asking for the status bar.

from phonegap-plugin-push.

macdonst avatar macdonst commented on July 20, 2024

@sebrojas14 Yes, when you specify an icon via init it is used in the status bar as well. I just pushed the code so try it out and I'm planning on bumping the plugin version shortly. Much thanks to @Deminetix for his assistance on this issue.

from phonegap-plugin-push.

ashconnell avatar ashconnell commented on July 20, 2024

@macdonst did you miss my PR?

from phonegap-plugin-push.

ashconnell avatar ashconnell commented on July 20, 2024

Oh sorry, I missed that. Hope its helfpul to peeps :)

from phonegap-plugin-push.

macdonst avatar macdonst commented on July 20, 2024

@Deminetix no, I didn't miss it. I used it but changed it up a bit. Again, I really appreciate you contributing to this plugin so keep at it.

from phonegap-plugin-push.

kentmw avatar kentmw commented on July 20, 2024

Just as a note to those like me using Phonegap Build to build your apk's, PGB currently doesn't let you add or copy images to the /res directory and because the NotificationBuilder specifically (at least in Lolipop and lower versions) requires a resource id, PGB users can not produce white/transparent icons unless your app icon itself fits the system icon/small icon/notification banner specifications.

Extra thoughts: I tried to fool PGB using qualifiers to the app icon and/or splash screen images to no avail. Also, it looks like in API level 23 (or code named M after Lolipop), you can generate icons programatically so you could pull an image in from www/ directory.

It looks like exploding your apk using a tool like apktool, adding the image to the res directory, and rebuilding it with -c flag is the only option - except perhaps dropping phonegap build altogether.

EDIT: ah, I see this is addressed in #118. Actually, almsot word for word...

from phonegap-plugin-push.

bguvenis avatar bguvenis commented on July 20, 2024

What about the small blue icon on the bottom right of "Large Icon - Loaded from drawables folder"? How do you set that? I see a white square inside a turquois circle. I want to give an image for that, or clear it for good.

from phonegap-plugin-push.

pke avatar pke commented on July 20, 2024

I am using an icon with alpha channel now but the cordova build process for android modifies the icon and removes the alpha channel.

from phonegap-plugin-push.

lock avatar lock commented on July 20, 2024

This thread has been automatically locked.

from phonegap-plugin-push.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.