-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Android: Notification icon problem #20
Comments
@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. |
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 |
@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: 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. |
So for now, is not possible to specify a different icon for the notifications? |
@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. |
I'll wait for it! thank you |
+1 this would be extremely helpful, white square are no fun! |
+1 Tested the TargetSDK workaround and it brings the full icon back for now at least. In your config.xml:
|
+1 Waiting for this also, we switched to this plugin because the PushPlugin repo is insanely outdated. |
@michael-may The target SDK workaround is not a very graceful fix. |
Nice! And what is the icon used in the notification bar? |
@sebrojas14 the small icon, specified at init time. |
Sorry, I was asking for the status bar. |
@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. |
@macdonst did you miss my PR? |
Oh sorry, I missed that. Hope its helfpul to peeps :) |
@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. |
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... |
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. |
Post android Lollipop release android has changed the guidelines for displaying notification icons in the Notification bar. You can see how to do this in detail with screenshots here Hope that helps |
I am using an icon with alpha channel now but the cordova build process for android modifies the icon and removes the alpha channel. |
This thread has been automatically locked. |
In lollipop, My notification look like this:
In the notification bar, it's a white square (with the old plugin, the same app icon was used here):
Notification bar expanded, a circle with the app icon inside (there's no way make somethinh better, like the other apps?):
The text was updated successfully, but these errors were encountered: