-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
I want to keep custom icon for notifications different from my app icon #1939
Comments
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? |
Yes you can create yourself. |
Thank you so much! Just produced the apk, my issue is now solved! Thank you! |
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.
Your Environment
"cordova-plugin-local-notification": "^0.9.0-beta.2", "cordova-plugin-local-notifications-mm": "^1.0.13",
cordova -v
): 10.0.0Expected Behavior
The transparent icon showing inside the box should not be there but on the top before the name of the app "Writeroo".
Actual Behavior
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)
The text was updated successfully, but these errors were encountered: