问题
I am updating my currently app. Having problems with getting my app icon to show in notification using the Local Notification plugin. https://github.com/katzer/cordova-plugin-local-notifications/
I have my notification setup as:
window.plugin.notification.local.schedule({
id: id,
ongoing: true,
autoCancel: false,
autoClear: false,
title: "Now Playing:",
text: title,
icon: "res://icon.png",
smallIcon: "res://icon.png",
});
I have an icon.png file in the following locations:
/www
/www/img
/www/res
And even tried the icon and smallIcon values without the res:// but it does not seem to work.
I keep getting a default android notification icon, looks like a bell.
Can anyone please help. Thank You.
回答1:
Had this problem too. It is due to Phonegap build updating to cli-6.5.0 that happened yesterday. I downgraded to cli-6.0.0 and it worked normally. Simply add this to your config.xml:
<preference name="phonegap-version" value="cli-6.0.0"/>
P.S. Could also work with other versions (for example 6.4.0) but haven't tried it since the above worked.
来源:https://stackoverflow.com/questions/42102449/phonegap-build-app-icon-does-not-apear