Hello there, since yesterday I was trying to fix a problem with missing icon on Android devices (ios works fine). I tried all solutions I found online eg.
icon: 'http://sciactive.com/pnotify/includes/github-icon.png'
icon: '../img/icon.png'
icon: 'img/icon.png'
icon: 'res://icon.png'
no matter how I change the icon property my notification shows as bellow :
APPNAME/platforms/android/res
My android platform files shows as bellow :
Code I am using to showing notification :
$cordovaLocalNotification.schedule({
id: email_id,
text: subject,
title: sender_name,
icon: 'http://sciactive.com/pnotify/includes/github-icon.png'
}).then(function () {
console.log('Notification triggered');
});
Any help will be highly appreciated :+1: :+1:
Thanks
Finally made it work thanks to @mix3d
All I had to do is mention which icon to pick.
$cordovaLocalNotification.schedule({
id: email_id,
text: subject,
title: sender_name,
icon: 'icon',
smallIcon: 'icon'
}).then(function () {
console.log('Notification triggered');
});
When I mentioned icon
android system automatically picking icon from drawable folders where I have a file named icon. If you want to use another file, put that file into your drawable folder and point to it.
If your drawable is too many, in my case drawable-hdpi
, drawable-land-hdpi
and 18 more folders. You have to place that file inside all those folders. Make sure your file size is exact as android icon file.
Will this solution work in IOS?
iOS automatically use system icon.
Nice one, solved my problem. Thanks
Most helpful comment
Finally made it work thanks to @mix3d
All I had to do is mention which icon to pick.
When I mentioned
icon
android system automatically picking icon from drawable folders where I have a file named icon. If you want to use another file, put that file into your drawable folder and point to it.If your drawable is too many, in my case
drawable-hdpi
,drawable-land-hdpi
and 18 more folders. You have to place that file inside all those folders. Make sure your file size is exact as android icon file.