smallIcon doesn't work any way
See original GitHub issueYour 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.0 -
Cordova platform version (
cordova platform ls
): android 8.1.0 -
Plugin config
Expected Behavior
Hi, I’m using this plugin in order to send a local notification to my user. I’m using this code:
cordova.plugins.notification.local.schedule({
id: Math.floor(Math.random() * 100),
title: "Notifica di prova",
text: 'Testo cordova',
icon: 'https://myurl.com/image.png', //this work
smallIcon: 'res://ic_launcher', // this doesn't work
led: "FF0266",
});
and my config.xml is setted like this:
<platform name="android">
<preference name="StatusBarOverlaysWebView" value="false" />
<preference name="android-minSdkVersion" value="21" />
<preference name="SplashMaintainAspectRatio" value="true" />
<splash density="land-hdpi" src="res/screen/android/drawable-hdpi/screen.png" />
<splash density="land-mdpi" src="res/screen/android/drawable-mdpi/screen.png" />
<splash density="land-xhdpi" src="res/screen/android/drawable-xhdpi/screen.png" />
<splash density="land-xxhdpi" src="res/screen/android/drawable-xxhdpi/screen.png" />
<splash density="land-xxxhdpi" src="res/screen/android/drawable-xxxhdpi/screen.png" />
<splash density="port-hdpi" src="res/screen/android/drawable-hdpi/screen.png" />
<splash density="port-mdpi" src="res/screen/android/drawable-mdpi/screen.png" />
<splash density="port-xhdpi" src="res/screen/android/drawable-xhdpi/screen.png" />
<splash density="port-xxhdpi" src="res/screen/android/drawable-xxhdpi/screen.png" />
<splash density="port-xxxhdpi" src="res/screen/android/drawable-xxxhdpi/screen.png" />
<icon density="ldpi" src="res/icon/android/mipmap-ldpi/ic_launcher.png" />
<icon density="mdpi" src="res/icon/android/mipmap-mdpi/ic_launcher.png" />
<icon density="hdpi" src="res/icon/android/mipmap-hdpi/ic_launcher.png" />
<icon density="xhdpi" src="res/icon/android/mipmap-xhdpi/ic_launcher.png" />
<icon density="xxhdpi" src="res/icon/android/mipmap-xxhdpi/ic_launcher.png" />
<icon density="xxxhdpi" src="res/icon/android/mipmap-xxxhdpi/ic_launcher.png" />
</platform>
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?
Issue Analytics
- State:
- Created 3 years ago
- Comments:7
Top Results From Across the Web
Windows 10 Some Icons not working??? - Microsoft Community
I haven't been able to find out why or fix it but some of the smaller icons in the bottom right on my...
Read more >How to Fix Broken or Missing Icons and Thumbnails in ...
Fix Icons and Thumbnails from Run or Command Prompt ... If you don't want to go through a third-party app, you can try...
Read more >Cordova Local Notifications smallIcon doesn't work any way
Using this code, local notification works fine, but the smallicon still remain grey. cordova.plugins.notification.local.schedule({ id: Math.
Read more >Windows 10 not showing the actual Icon in small icon view
Just not in small icons or details view. I have tried adjusting Thumbnail cache size, applying the registry fix for broken icon filetypes, ......
Read more >How to Fix Icons Not Showing on Taskbar in Windows 10 ...
How to Fix Icons Not Showing on Taskbar in Windows 10 [Tutorial]Sometimes you may find that your System Tray Notification Area Icons, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It worked for me with following setup:
config.xml
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). Don’t use dashes (
-
) in the filename. Otherwise, you get errors on building.then use the following in the trigger event:
I can confirm the solution provided by @chvonrohr worked for me, tested on Android 10 and Android 8 (oneplus6 and samsung j3)