Skip to content
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

Missing icon #932

Closed
ibnbd opened this issue Apr 8, 2016 · 4 comments
Closed

Missing icon #932

ibnbd opened this issue Apr 8, 2016 · 4 comments

Comments

@ibnbd
Copy link

ibnbd commented Apr 8, 2016

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 :

screen

APPNAME/platforms/android/res

My android platform files shows as bellow :
screen2

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 👍 👍

Thanks

@ibnbd
Copy link
Author

ibnbd commented Apr 8, 2016

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.

@theavijitsarkar
Copy link

Will this solution work in IOS?

@ibnbd
Copy link
Author

ibnbd commented Apr 12, 2016

iOS automatically use system icon.

@pure4Sk
Copy link

pure4Sk commented Apr 22, 2016

Nice one, solved my problem. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants