Phonegap: Flexible iOS app update (no AppStore)

I have an app for iOS Phonegap. My application is distributed privately, so there is and will not be an application store. The application interacts with homebrew middleware. To manage application updates, I thought of doing something like:

-> At the beginning of the application, check if a newer version is available.

-> If yes, then call the home-made Javascript module, which will use the I / O API for HTML5 files to update / create / delete files based on the output of the middleware.

  • In your opinion; is this a reliable solution?

  • Are there any alternatives? (application store is not working completely)

+4
source share
5 answers

In PhoneGap / Cordova, you usually download files from your local www folder. The problem with updating files at run time is that you cannot write to the www location - you can only write to your documents folder.

I assume that you are using the Enterprise distribution, since you are distributing it without an app store. You can see how to use TestFlight to distribute updates if you are satisfied that users need to go and check for updates.

You can also eliminate TestFlight and place ipa files yourself, check for updates and ask the user to download and install the update.

EDIT

It is not possible to write to the www folder with or without a plugin. This is due to iOS limitations, not PhoneGap / Cordova restrictions.

These links talk about distributing enterprise applications on the air http://developer.apple.com/library/ios/#featuredarticles/FA_Wireless_Enterprise_App_Distribution/Introduction/Introduction.html

IOS Enterprise Distribution via OTA

Enterprise app distribution

+4
source

I considered using the www folder as a bootstrap to load the actual application into the www folder in the document directory and loading the index.html page from here (and the rest of the application).

I wonder if this will be an option

Of course, ObjectiveC UIWebView points to the loaded version, if it exists

+2
source

I know this is an old question, but the accepted answer is no longer correct. Here is a complete project showing how to do this: https://github.com/ben-ng/phonegap-air

In short, the trick is not to write to the application package, but to the Documents folder.

+2
source

There is an alternative service Trigger.io . This is very similar to a phone call, but one of its β€œkey features” is that it allows you to β€œ reload ” the application on the device, which is what you are looking for, AFAICT.

+1
source

So, it seems that cordava can only download files that are in the application bundle. You cannot just change the webroot parameter to take the document folder.

What you can do is use the FileReader API to read from persistent storage. This would mean that you need to create some kind of bootable html / javascript, which is in the application bundle, and create code that loads the contents from the persistent storage (which you can update yourself at any time)

This is a great place to search: Cordava File API Documents

0
source

All Articles