I have created a hybrid app using ionic2
in that I am using cordova local push notification.
Everything working perfectly only thing is not able change a icon, in below I have paste my code here.
LocalNotifications.schedule({
id:1,
title: "Test Title",
text: "Push Notification",
icon: "res://icon.png",
at: new Date(new Date().getTime() + 5 * 1000),
sound: null,
every: "minute"
});
And also I tried this below code.
LocalNotifications.schedule({
id:1,
title: "Test Title",
text: "Push Notification",
icon: "http://icons.iconarchive.com/icons/treetog/junior/256/camera-icon.png",
at: new Date(new Date().getTime() + 5 * 1000),
sound: null,
every: "minute"
});
If I am using remote url the app forced to stop. Any one help me to solve this.
Put your icon.png file in src\assets\img directory for icon and for small icon put icon.png file in platforms\android\res\drawable directory
Assuming that you have stored your icon.png in your res directory!
There are two methods that you can use to direct to res folder and its content:
I have used two 50x50 size icons that are stored in: platforms/android/res/drawable
and are named: koala6.jpg and icon2.png
But you can store your icons in any sub-directory of res.
You can show one of these two images by using one of the methods shown above:
As this example shows the image-extensions (.png, .jpg) are left out.
When you want to show 50x50 images via url:
Define some permissions in your AndroidManifest.xml:
Then you can show them as you did it by using image-extensions (.png, .jpg)
Hope this helps.