问题
I'm developing some apps where the clients wants to implement design changes, adding new content fields etc after the app has been delivered. Also at the moment the apps are done through RhoMobile but I'm planning to switch away to Cordova.
So far I'm just doing it all as it comes along and then sending it off to be approved by the powers that be. But for relatively small changes coming from the clients and then waiting for the app to get approved again… Sure, this is also a management issue when they don't think things through enough, but I'm just trying to see if there's a way of offsetting that. :)
For example I just got asked to add an overview page for memberships in the app. I already have a page defined in the shipped app for the membership page, so adding the extra data wouldn't be so hard if I could just update the javascript that is running on the phone already.
- Am I allowed to do this according to Apples policies?
- Are there any pre-built frameworks for handling this problem, or am I destined to look at it myself? :)
- Are there other alternatives that I'm not thinking of?
回答1:
Question is old, but the problem is still actual. Recently there's been released a Cordova plugin, called Hot code push plugin. You can check him out. Using it you can update all your web content, that is packed in the application: JS, CSS, HTML, images and so on. But if you want to add some new plugins to the app - you'll have to release new version on the stores.
Unfortunately, right now this plugin supports only iOS and Android, but maybe this will be enough.
About the Apple policy: you can update your application like that, but only if that doesn't change the initial purpose of the app. If application was released as a calculator, but after the update it becomes a game - Apple can ban you.
回答2:
Packages submitted to app stores are code signed. This is one of the many mechanisms in place to ensure package integrity. Which leads to updating executing code without an app update not a viable option.
You can include external JS files in very limited capacity (think childbrowser). PhoneGap build has a feature called Hydration builds. But that works only during development.
For full app updates, HockeyKit is an option too.
来源:https://stackoverflow.com/questions/13093995/updating-javascript-code-in-cordova-app-after-it-has-been-published-in-the-app-s