Comments (24)
+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.
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.
@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.
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.
@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.
from phonegap-plugin-push.
So for now, is not possible to specify a different icon for the notifications?
from phonegap-plugin-push.
@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.
I'll wait for it! thank you
from phonegap-plugin-push.
+1 this would be extremely helpful, white square are no fun!
from phonegap-plugin-push.
+1 Waiting for this also, we switched to this plugin because the PushPlugin repo is insanely outdated.
from phonegap-plugin-push.
@michael-may The target SDK workaround is not a very graceful fix.
from phonegap-plugin-push.
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.
from phonegap-plugin-push.
Nice! And what is the icon used in the notification bar?
from phonegap-plugin-push.
@sebrojas14 the small icon, specified at init time.
from phonegap-plugin-push.
from phonegap-plugin-push.
Sorry, I was asking for the status bar.
from phonegap-plugin-push.
@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.
@macdonst did you miss my PR?
from phonegap-plugin-push.
Oh sorry, I missed that. Hope its helfpul to peeps :)
from phonegap-plugin-push.
@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.
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.
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.
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.
This thread has been automatically locked.
from phonegap-plugin-push.
Related Issues (20)
- Callbacks (hasPermission, register) are not called on iOs 13 HOT 3
- @parmarkaushik15 yeah, like I said in my last comment, if the app is forced closed there is no web view in memory to run the JS. The best you can do at this point is look into using the force start parameter. HOT 1
- ios: notification event not firing after app is closed when user opens app directly - works on android HOT 1
- On notification event not firing when cordova local notification plugin is installed. HOT 5
- IOS. Does not show 'Allow / Deny' notification dialog and not receiving push notification
- Blank screen is displayed in few devices instead of picture
- iOS13 APNS Device Token HOT 2
- getNotificationSettingsWithCompletionHandler - completion handler never executes on iOS 9.3.5
- Incompatibilty phonegap-plugin-push whit cordova-plugin-googlemaps HOT 5
- Unable to send push to browser(Firefox, Chrome) using fcm/gcm getting 'InvalidRegistration'
- On Android it receives notifications but they don't appear on Firebase Analytics
- Not every key in the firebase's {android/ios}.notification object is supported in "additionalData" object
- Unable to compile 2.3.0
- HELP - Failed to install 'phonegap-plugin-push': undefined - cocoapods -macOs Catalina HOT 1
- registration is not called
- iOS: Can't process background notification on low battery
- Security Error with android:exported=true
- [Android] on('notification') 'coldstart' value is acting wacky and not as documented (works only on iOS)
- Sporadic registrations on iOS using Xcode
- FCM version is not up-to-date.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phonegap-plugin-push.