Hi,
Is there any way to add images to the /res/drawable-* folders of the generated App package?
All I could find was how to Modify the App Icon, and in the Extensibility Configurations JSON Schema page there is no mention of the possibility of adding extra images, or any other kind of resource, to the App.
Thank you.
CA
Hello,
I've found a way of adding images to the /res/drawable-* folders of the generated App package, by using a dummy Cordova Plugin. The images, and possibly other files, are included using the <resource-file /> directives of the plugin.xml file.
An example plugin code is in the zip file attached, in this case it adds the Pushwoosh notification icons as described in the Pushwoosh Android FAQ - How to set a notification icon in Android Lollipop.
These are the steps to use it:
1 - Open the main application module and import the new or the updated zip file to the resources folder:
2- In the Extensibility Configurations value window, create a JSON object to include the dummy plugin:
{ "plugin": { "resource": "/dummy-android-plugin" }, "resources": "dummy-android-plugin.zip" }
Carlos Alfaro wrote:
{ "plugin": { "resource": "/dummy-android-plugin" }, "resources": "dummy-android-plugin.zip"; }
Hi Carlos,
I follow your step and get error when create JSON object. I got error on ' ; ' after .zip"
when i delete ; the error is gone but icon not change still got default icon (white bell)
What i supposed to do?
Hello Carlos, I was following exactly as you mentioned in the previous post but I got this result
please if someone can give me a clue to the problem
Hi Dedy,
Thank you for the correction to the typo in plugin code.
Are you using the mobile Pushwoosh Plugin? You should get by default a white square, not a white bell.
Hi everyone!
I tried this and it is working using OneSignal Plugin also.
Thank you Carlos for your help! It was amazing! You deserve a Nobel Prize ;-)
Cheers
Luciano Guimaraes
Love it.
I was looking around for a long time for this.
Hello Emmanuel,
When I had this problem it is because I was zipping the top-level folder rather than highlighting all the resource files and zipping those. So the zip folder directory was:
res.zip > res > dummy-android-plugin
Instead of just
res.zip > dummy-android-plugin
HI,
I'm getting Error: Invalid resources type in your extensibility configurations. Review it and try again.
Has something changed?
Kind Regards
Nathan
Alfaro,
You need to lose the S from resources:
{ "plugin": { "resource": "/dummy-android-plugin" }, "resources": "dummy-android-plugin.zip"}
Nathan Hobbs