katzer / cordova-plugin-local-notifications

Cordova Local-Notification Plugin
Apache License 2.0
2.57k stars 1.76k forks source link

How to add small icon to notification? #1011

Closed Script47 closed 7 years ago

Script47 commented 8 years ago

I'm trying to add my app icon to the notifications that I'm sending out. I have PNG file which I want to use, but I'm unsure how to use make it work.

Attempt 1

cordova.plugins.notification.local.schedule({
    id: 2,
    title: 'Some Title',
    text: 'Some Text',
    smallIcon: 'assets/images/icons/mipmap-ldpi/ic_launcher.png',
    every: 'week' // "minute", "hour", "week", "month", "year"
});

Attempt 2

cordova.plugins.notification.local.schedule({
    id: 2,
    title: 'Some Title',
    text: 'Some Text',
    smallIcon: 'http://www.myurl.com/image.png',
    every: 'week' // "minute", "hour", "week", "month", "year"
});

I'm using Intel XDK so the project structure is different.

Is there any specification which has to be met i.e. the image size has to be a specific size etc.

Any help will be much appreciated.

DavidBriglio commented 8 years ago

According to the wiki, you can only use icons that are in the 'res' folder. There are also guidelines for the size of image to use.

https://github.com/katzer/cordova-plugin-local-notifications/wiki/04.-Scheduling Uri of the resource (only res://) to use in the notification layouts. Different classes of devices may return different sizes

  • Default: res://ic_popup_reminder
rwillett commented 7 years ago

Is this still an issue? Its not been updated in six months?

rwillett commented 7 years ago

No update from original poster so closing.