0

I am experiencing problems when trying to set a notification icon in the Local Notifications Plugin. I tried following the instructions of the plugin on Github, but it didn't work.

The icon I want to use is in the www/img folder, I tried using file:// approach and also by using icons from the drawable folder using the res:// approach. But both of these approaches did not yield any results.

This is my schedule notification method:

$scope.scheduleSingleNotification = function () {
  $cordovaLocalNotification.schedule({
    id: 1,
    title: 'Countdown abgelaufen',
    text: 'Die Zeit ist rum!',
    badge: 1,
    icon: 'file://img/icon_small.png',
      data: {
        customProperty: 'custom value 1'
      }
    }).then(function (result) {
      console.log('Notification 1 triggered');
    });
  };

The notification itself works fine, but I am unable to change the icon. Can anyone help me solve this problem?

Dexter
  • 2,462
  • 4
  • 24
  • 28
Torben G
  • 750
  • 2
  • 11
  • 33
  • 1
    have you looked at [this issue](https://github.com/katzer/cordova-plugin-local-notifications/issues/966) ? it might help – Arpit Vasani Dec 05 '16 at 13:56
  • 1
    Are you sure that the image you are using complies with the requirements on Android? Or are you not testing on Android? – Dexter Dec 05 '16 at 14:05
  • Thanks a lot :) it works fine. But i have a new question, sorry :) how can i add colors to my icon? eg a background color? your icon from the issue page are orange. Where is your transparency their? – Torben G Dec 05 '16 at 16:37

0 Answers0