WARNING: IF YOU IGNORE THIS TEMPLATE, WE'LL IGNORE YOUR ISSUE. YOU MUST FILL THIS IN!
Okay so I have been searching a fix for a lot of days.
When the app shows a notification, there is a notification icon that shows which app the notification is from.
I DONT mean the icons or images inside the notification box.
I tried doing this -
cordova.plugins.notification.local.schedule({
id: 1,
title: 'title',
text: 'text',
icon: 'file://med/icon.png',
smallIcon: 'file://med/icon.png',
color: '#44c54d'
});
and this is the output
now see - I do not want the green blob before the name of the app. That icon is the app icon I have set in the config file. Instead I want the icon showing in the right inside the box to be where the green blob is.
"cordova-plugin-local-notification": "^0.9.0-beta.2",
"cordova-plugin-local-notifications-mm": "^1.0.13",
cordova -v
): 10.0.0The transparent icon showing inside the box should not be there but on the top before the name of the app "Writeroo".
The app icon which I set as a local file on my pc (given below) is being shown as the icon for the notification besides the app name "Writeroo". (it appears as a green blob which is because of my android making icons single color.)
(App Icon)
But I want that icon to be changed to another custom Icon I have made, shown below
(Icon I want to show)
Hello,
Create a resource file inside resources/android/notification and inside config.xml :
<platform name="android">
<resource-file src="resources/android/notification/drawable-mdpi/notif.png" target="app/src/main/res/drawable-mdpi/notif.png" />
<resource-file src="resources/android/notification/drawable-hdpi/notif.png" target="app/src/main/res/drawable-hdpi/notif.png" />
<resource-file src="resources/android/notification/drawable-xhdpi/notif.png" target="app/src/main/res/drawable-xhdpi/notif.png" />
<resource-file src="resources/android/notification/drawable-xxhdpi/notif.png" target="app/src/main/res/drawable-xxhdpi/notif.png" />
<resource-file src="resources/android/notification/drawable-xxxhdpi/notif.png" target="app/src/main/res/drawable-xxxhdpi/notif.png" />
In your code :
cordova.plugins.notification.local.schedule({ id: 1, title: 'title', text: 'text', icon: 'res://notif.png', smallIcon: 'res://notif.png', color: '#44c54d' });
It work in my Ionic app (v3 and v5)
I hope this will help you
Fabien
okay so I am clearly new to this, I cant find a resources folder in my cordova directory. Can you guide me where to find this or do I create this folder myself?
I am using plain cordova.
Yes you can create yourself.
A demo project : https://github.com/fcastell/cordovalocalnotif
To create icon you can use this tool : http://romannurik.github.io/AndroidAssetStudio/index.html
Thank you so much! Just produced the apk, my issue is now solved! Thank you!
Most helpful comment
Yes you can create yourself.
A demo project : https://github.com/fcastell/cordovalocalnotif
To create icon you can use this tool : http://romannurik.github.io/AndroidAssetStudio/index.html