Open LucaTrip opened 5 years ago
Per me è la cipolla.
I am also facing a similar issue.
Icon-
Inside details-
Please help.
I have figured this out.
You have to look into the folder: \platforms\android\app\src\main\res
In there you'll see folders like "mipmap-ldpi" Inside of those you'll see files named "ic_launcher.png"
This is the name of your icon file.
Now when you set your defaults you put that name (without .png) in the icon property:
cordova.plugins.backgroundMode.setDefaults({
title: 'your name',
text: 'your text',
icon: 'ic_launcher',
resume: true,
hidden: false
});
Now I think the icon also has to be black and white for some reason. But I can't confirm yes/no in regards to that.
I have figured this out. You have to look into the folder: \platforms\android\app\src\main\res In there you'll see folders like "mipmap-ldpi" Inside of those you'll see files named "ic_launcher.png"
This is the name of your icon file.
Now when you set your defaults you put that name (without .png) in the icon property:
cordova.plugins.backgroundMode.setDefaults({ title: 'your name', text: 'your text', icon: 'ic_launcher', resume: true, hidden: false });
Now I think the icon also has to be black and white for some reason. But I can't confirm yes/no in regards to that.
Thx a lot!! I got into the same problem :). Testing it within drawable but it has to be in mimap to work. My icon is white with transparent BG.
I'm trying to change the notification icon but with poor results. This is what I do:
cordova.plugins.backgroundMode.setDefaults({ title: 'my title', text: 'my text', icon: 'icon' // this will look for icon.png in platforms/android/res/drawable|mipmap });
inside enable event. I created the res/drawable/ folder in platforms/android because in cordova-android 7 the res folder is in another place. inside the drawable folder there is icon.png with lpdi density but doesn't work.