Is it possible to update the content of WWW folder in phonegap without submitting the app every time you make changes to appStore?
Is there any legal issue with it?
Is it possible to update the content of WWW folder in phonegap without submitting
Share
Short answer – yes, you can – but you need to relocate www before you can write to it.
Long answer – tighten up your shorts pilgrim, this might get bumpy….
So, when you package your app, the app bundle contains your www directory and all of the various and sundry parts of your PG self contained web app. Everything that is part of the app bundle is static – so it cannot be written to. You can, however, write to the NSDocumentDirectory for your application – it’s private sandboxed storage area.
The first step is to (upon launch) copy your www folder into the NSDocumentDirectory.
Second, you’ll need to override the CDVCommandDelegateImpl pathForResource method in order to point PG at the new www location.
At this point your app should be operating as it did when contained within the app bundle. One notable exception is that each of the files can now be modified.
My app is a base product which can have add-on content. If I included all of the add-on content, the app would be several hundred MB in size. So, I include the basic app with a single (sample) data package, and as users need to extend the product, they select additional data packages which are downloaded, extracted and copied into the appropriate subdirectory of the www folder as it exists in the NSDocumentDirectory.
As a bonus, if I find a bug in HTML – or want to add a feature, I can do so without resubmitting the app. The only reason I need to resubmit the app is if there is an Objective-C bugfix.