Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cordova / Phonegap: Live update codebase

We are using Cordova along with AngularJS for iOS and Android applications.

One big disadvantage of iOS are the long review times from Apple. In Google's Playstore, your app is available nearly immediately, or within a few hours. But Apple takes ages to review your app, even when it's only a small change.

So I was thinking, if there is a way to support some kind of live update.
That means, I could provide a ZIP file or something else with a new codebase, my app checks for updates and then installs the new files.

I've read something from appmobi, but are there any open source solutions?

like image 669
23tux Avatar asked Nov 17 '14 15:11

23tux


2 Answers

cordova-app-loader is an easy to use plugin to update app files via 3 simple steps:

  1. check() for a new manifest
  2. download() files
  3. update() your app!

It supports android and iOS

like image 79
Ali Gonabadi Avatar answered Sep 28 '22 01:09

Ali Gonabadi


I don't know of any ready made solutions for that, but it should be easy enough to program something like this on your own. Here are some points to get you started and to consider:

  • If you want to distribute updates via zip, you need a nativ plugin which handles the extraction
  • You might not be able to override files in the default location of your app (depending on OS). So, all files you want to update in the future have to sit in a folder your app has read/write access to (iOS: e.g. Library or Documents folder)
  • Now you simply need to download the zip-package, unpack the zip to your chosen directory, and restart/reload your app.
  • you will not be able to update native plugins!
  • Apple probably doesn't like that, since you are able to change the whole application without passing their review process
like image 43
Jeremy Avatar answered Sep 28 '22 01:09

Jeremy