When developing, I didn’t see any issues (and still don’t). I then released my app to both app stores. Deleted my dev versions of the apps and installed the ones from the app stores (on Android 4.4.4 with Crosswalk and iOS 8.1).
Problem 1: Pushed new code to the server and neither of the apps on my test devices detected the new manifest. Could not figure out why. Reinstalled dev versions and it all worked fine. Suspected it might have something to do with the app store deployment being different, but generated and manually installed release apk and ad-hoc ipa onto my devices and they worked fine. Also one of my users was prompted to do the update. Never did figure out why this didn’t work.
Problem 2: I had added a new template file and updated my main js and css files in the update. When the update was applied on an Android phone, the new template file and js seemed fine. The new CSS did not get applied, so things looked bad. I didn’t see this problem on iOS - the updates were applied properly.
There is always the possibility that some or all of this was due to a server problem at the time and that the appropriate data wasn’t being sent down to the app. I’m about to submit new apps to the app stores, and will leave cordova-app-loader in for now and give it another go. I’ll let you know how it goes.
If I can’t get it working, it appears that application cache for “hot code push” is a viable way to go. Here’s what I’ve learned:
There’s a nice description of how @mikemintz implemented it here:
and described by @SidneyS here:
More details on application cache:
- অ্যাপ্লিকেশন ক্যাশে ব্যবহার করার জন্য একটি শিক্ষানবিস গাইড | Articles | web.dev
- http://appcache.offline.technology/
- Application Cache is a Douchebag – A List Apart
Notes:
- uses built in browser functionality - good
- You need to put all the cordova and cordova plugin files on your server as well as your app files, and have different versions per platform. Something like this from @andrewreedy could help: https://github.com/andrewreedy/cordova-loader
- it appears that you don’t need to package any of your app code into your binary (which makes the binary lighter), but on first run (and until all the files are cached), you will be running your app from the server, and all the files will be downloaded and cached in the background
- if any of the files listed in CACHE can’t be retrieved, the entire cache is disregarded
- I had thought that it re-downloaded everything in the manifest, but according to the second link above - “When updating an existing appcache, the browser sends standard If-Modified-Since headers, so it skips re-downloading files that have not changed.” which is nice, although in practice you’re probably uploading newly generated versions of the files, even if they haven’t changed.