It is mainly divided into two steps: the first is how to know that there is a new version, and the second is how to upgrade to the new version.
How to know the new version: After opening the app, after the welcome interface is rendered, send an http request to the server to check whether it needs to be updated. If there is an update, and it is not a forced update, a prompt will pop up. The user clicks Update to update. Click Don't. If it is updated, it will not be updated. To be friendly, you can click to ignore this version; if it is a forced update, the user will update by clicking the update button, and exit the APP if he clicks the update button.
Of course, iOS users can also directly request the app store’s API to check whether there are updates, which is more reliable and the principle is still the same
How to upgrade after knowing a new version: Android and iOS apps have different upgrade methods. Android allows users to download apk and install it, while iOS can only jump to itunes. If you are lazy, you can use some third-party application markets, such as Tencent's After the user clicks on App Store, he can jump directly to Tencent's App Store. App Store will let him download the apk or jump to the iTunes store according to the user's operating system.
======Cut, cut, cut======
2) Let’s talk about automatic updates. What I understand as automatic updates is direct updates without user operation. Generally, automatic updates of APP require downloading a new version and then installing it. For this, android apps are more flexible and can even The old app automatically downloads the new app and then triggers the installation. In this way, the update is completely automatic (no user needs to click update). There is no way for iOS, and it must be updated in iTunes.
However, smart developers can still solve this problem. The basic principle is to call the local interface through js. When the APP is updated, just load the latest js file from the server. This can, to a certain extent, solve the problem of automatically upgrading without requiring users to jump to iTunes. Of course, the premise is that your APP is hybrid. Specific examples include the JPatch library.
You can refer to this article: http://segmentfault.com/a/1190000003973865
Android hot patch AndFix AndFix is an online hot patch framework for Android App. Using this framework, we can modify the bugs in the App online without re-releasing it. AndFix is the abbreviation of "Android Hot-Fix". For now, AndFix supports Android versions 2.3 to 6.0, and supports devices with arm and X86 system architectures. Perfectly supports Dalvik and ART's Runtime. AndFix’s patch files are files ending with .apatch. AndFix is an Alibaba open source project.
1) Let’s first let users update:
It is mainly divided into two steps: the first is how to know that there is a new version, and the second is how to upgrade to the new version.
How to know the new version: After opening the app, after the welcome interface is rendered, send an http request to the server to check whether it needs to be updated. If there is an update, and it is not a forced update, a prompt will pop up. The user clicks Update to update. Click Don't. If it is updated, it will not be updated. To be friendly, you can click to ignore this version; if it is a forced update, the user will update by clicking the update button, and exit the APP if he clicks the update button.
Of course, iOS users can also directly request the app store’s API to check whether there are updates, which is more reliable and the principle is still the sameThere are generally several ways to update iOS apps:
It is judged based on the bundle version inside the App and prompts the user to update. In fact, it is still updated from the App store.
Generally for test users, OTA (over the air) technology is used to provide a link for users to download from here.
Use JSPatch and other JS technologies to achieve real-time updates. Generally, they are used in Hybrid apps
Android hot patch AndFix
AndFix is an online hot patch framework for Android App. Using this framework, we can modify the bugs in the App online without re-releasing it. AndFix is the abbreviation of "Android Hot-Fix".
For now, AndFix supports Android versions 2.3 to 6.0, and supports devices with arm and X86 system architectures. Perfectly supports Dalvik and ART's Runtime.
AndFix’s patch files are files ending with .apatch.
AndFix is an Alibaba open source project.
Github: https://github.com/alibaba/AndFix