This is a migrated thread and some comments may be shown as answers.

Updating or adding Javascript files without having to submit to appstores everytime

1 Answer 286 Views
Apache Cordova
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Carlos
Top achievements
Rank 1
Carlos asked on 08 Apr 2016, 05:40 PM

We are trying to find a way to update our app and add features (such as modules, game levels, etc), without having to go through the appstore for every feature release or every level upgrade.  

How we see this happening is items such as new game levels, simple features or HTML tweaks.  

Something like, we would have our base app, THEN we want to know if the user wants to turn on a feature or get a new level, or if we want to provide a new section of our app but let the user opt in to getting it.  We would have our JS files out on our server and when if the user wants to add it to their app, the app would fetch the new feature (JS) file from our server, download it to the device in the file system and then the app would would read the new JS file and that feature would now be apart of the app.  This is an advantage to our user because we would not have to load all the features into one app and then release to the store and have the app be some huge 200mb app.  But instead let the user choose what features they want to add to their app.  

I did some Googling and found someone had done this with the vanilla Phonegap projects, but I am wondering if we have the same access through an AppBuilder project. 

Here is the post and how someone did this with their Phonegap project.

http://stackoverflow.com/questions/12865316/phonegap-updating-javascript-and-css-without-submitting-the-app-to-appstore

 

In the StackOverflow question, the person who answer's the question recommends moving the WWW folder to NSDocumentDirectory, but since in AppBuilder we do not see or have a WWW folder, how would this work in an AppBuilder app?  Any suggestions, pointers, and code examples to get us on our way would be greatly appreciated.

 

Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Martin Yankov
Telerik team
answered on 13 Apr 2016, 11:14 AM
Hi Carlos,

First, let me explain that hybrid apps built with AppBuilder have a /www folder. All the files and folders that you see in the AppBuilder client are then packaged into it. If you build an app package, rename it to a .zip and extract it, you can find the /www folder. It's located in a different place depending on the platform. For Android apps it's in /assets/www. For iOS apps it's in Payload/CordovaXXX.app/www.

That being said, the proposed solution in SO is suggesting you should modify the Cordova source files themselves. Telerik AppBuilder works with predefined stable and tested versions of Cordova for each platform and doesn't let you change the underlying source code. Any changes on the Cordova framework code can potentially break the whole framework and that is why we don't let you override the source code.

Moreover, the suggested solution is quite old and sounds like something that breaks the application sandbox model. Several versions of iOS and Android have been released since then and I can't guarantee it will work even if you try to do this with the bare bones Cordova CLI.

The common scenario with games and assets driven apps is that you don't have to update your source code. It's shouldn't be that big. You should have all the source code in the app and download all the necessary assets - images, data in the form of json, audio, video etc when the user wants to activate new stuff. You can easily download assets using the Cordova File plugin and then cache them in your app. Most big apps on the App Store are small and download huge amounts of assets on first startup.

You can also check out the AppManager LiveSync feature that the Telerik Platform provides. It is available only for the Enterprise subscription level. It won't let you download chunks on demand, but it will let you update your front end code without the need to go through the store publishing process.

I hope this information helps. If you have any questions I will be glad to answer them.

Regards,
Martin Yankov
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
Tags
Apache Cordova
Asked by
Carlos
Top achievements
Rank 1
Answers by
Martin Yankov
Telerik team
Share this question
or