How to change icon local notifications


#1

i want change icon local notifications

code:

but it not change ,it using icon default.


#2

Where does “LocalNotifications” come from? Hard to tell if your parameters you are giving it makes sense without knowing what library you are using…


#3

Sorry, I followed http://ionicframework.com/docs/native/local-notifications/, it worked fine but the icon did not change, it used the default icon.


#4

Check http://ionicframework.com/docs/native/local-notifications/#ILocalNotification and scroll down to the icon part.

Also the Cordova plugin that this uses documents the URLs to use a bit more:
https://github.com/katzer/cordova-plugin-local-notifications/wiki/10.-URIs#overview

So you should probaply prepend your icon with file://. If .ico works at all is unclear, here they always use png.


#5

i have : and i set icon: “file://img/clock1.png” . where am i wrong ? . it is not change. thanks.


#6

If this is the way to do this, and I don’t know, I only read the documentation, but haven’t used this myself, it would be file://assetts/img/clock1.png of course.


#7

thanks but it not change


#8

Then maybe create a new blank project, only include code for the local notification, put it on Github - maybe I’ll have time later to play with it a bit.


#10

I can change it with the follow code.
this.localNotifications.schedule({
id: 1,
title: ‘Company’,
text: msj,
led: ‘FF0000’,
icon: ‘assets://icon/icon-notify’,
smallIcon: ‘assets://icon/icon-notify-small’
});
Please atention with image path.

I hope help u !