How to add custom image using phonegap-build
I am using cordova-plugin-themeablebrowser which requires some custom images. The plugin page said that I need to copy images to some directories.
Doing this works correctly, but unfortunately all builds are done using Adobe Phonegap Build.
How can I add these custom images when I build with Phonegap build?
source to share
UPDATE (1/19/2015):
This fix was suggested by a github user: @shamank
push = PushNotification.init({
"android": {
"senderID": "mySenderId",
"icon": "myIcon", // will look for myIcon.png in res/drawable
"iconColor": "#00AABB"
}
});
To get the icon in res / drawable folder, you need to create folder structure: locales / android / drawable at the root of your project. Then paste your custom icon into that folder with the same name you referenced in PushNotification.init. The build engine will move the assets under / locales / android / drawable to the res / drawable directory of the embedded apk.
END UPDATE
While the description in the question points to this issue affecting one plugin, cordova-plugin-themeablebrowser, which has now been updated to be pulled from the www directory, the question itself refers to a much more serious issue with phonegap builds. Not every plugin can satisfy you this way. In some cases, this will not be possible, since with small icons push notifications.
You can read more about this issue here: https://github.com/phonegap/phonegap-plugin-push/issues/118
This basically goes to show that Phonegap Build cannot copy any resources, and we had no luck trying to get it to do what we want. However, you can take advantage of the fact that plugins can specify their own resources. You can create your own plugin to copy the resources you want them to go to.
I have created a template plugin repository that can be forked and added an additional icon. Or, you can just use it as a guide to copy whatever resources you want. This is not the best solution - Phonegap Build, which offers a way to pull resources from your application, would be preferable, but it works!
https://github.com/kentmw/secondary-icon
EDIT: You can follow the progress of the PGB extension request: https://github.com/phonegap/build/issues/472
source to share