-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
smallIcon doesn't work any way #1890
Comments
It does work. It's just a little bit hard to make it work :) There are specific requirements for the image itself (transparency) and the location. You need to put the icon here: platforms/android/app/src/main/res/drawable (manually create it) And then use smallIcon: 'res://logo.png' Here are two topics, read them carefully: https://github.com/katzer/cordova-plugin-local-notifications/wiki/10.-URIs |
@AsoStrife How did you manage to solve this issue? |
It worked for me with following setup: config.xml <platform name="android">
<resource-file src="resources/android/notification/mia_icon_hdpi.png" target="/app/src/main/res/drawable-hdpi/mia_notification_icon.png" />
<resource-file src="resources/android/notification/mia_icon_mdpi.png" target="/app/src/main/res/drawable-mdpi/mia_notification_icon.png" />
<resource-file src="resources/android/notification/mia_icon_xhdpi.png" target="/app/src/main/res/drawable-xhdpi/mia_notification_icon.png" />
<resource-file src="resources/android/notification/mia_icon_xxhdpi.png" target="/app/src/main/res/drawable-xxhdpi/mia_notification_icon.png" />
<resource-file src="resources/android/notification/mia_icon_xxxhdpi.png" target="/app/src/main/res/drawable-xxxhdpi/mia_notification_icon.png" />
</platform> Icon should have transparent background. It's not possible to have differente colors, Android will apply color show it grayscaled (or the color you define - see below). then use the following in the trigger event: {
// .. other settings
smallIcon: 'res://mia_notification_icon`,
color: '#D3002E' // color for icon and action buttons
} |
I can confirm the solution provided by @chvonrohr worked for me, tested on Android 10 and Android 8 (oneplus6 and samsung j3) |
No still facing the problem even after trying with above information .As explained above ,I placed the icon in 'platforms/android/app/src/main/res/drawable' but it was not showing the icon still |
i would add a note, color profile of the images is very important, i spent couple of hours to understand it, then i found this tool https://romannurik.github.io/AndroidAssetStudio/index.html just click on "notification icon generator" and follow the instructions |
Thanks. This worked for me. |
Your Environment
Plugin version: 0.9.0-beta.2
Platform: Android
OS version: 10
Device manufacturer / model: Xiaomi Mi 8 Lite, but tried with differents emulator and other devices
Cordova version (
cordova -v
): 9.0.0Cordova platform version (
cordova platform ls
): android 8.1.0Plugin config
Expected Behavior
Hi, I'm using this plugin in order to send a local notification to my user.
I'm using this code:
and my config.xml is setted like this:
Actual Behavior
But when the phone recive the local notification, smallIcon is not shown. I see only a gray circular icon
My question
I've tried all the solution proposed in this issue repository and all answers on stackoverflow. Is this plugin version bugged or I'm doing something wrong?
The text was updated successfully, but these errors were encountered: