Skip to content

Latest commit

 

History

History
76 lines (53 loc) · 1.58 KB

README.md

File metadata and controls

76 lines (53 loc) · 1.58 KB

cordova-plugin-app-update

App updater for Cordova/PhoneGap

Demo

Try it yourself:

Just clone and install this demo. cordova-plugin-app-update-DEMO 🎉

Preview

enter image description here

enter image description here

Install

Latest published version on npm (with Cordova CLI >= 5.0.0)

cordova plugin add cordova-plugin-app-update

Usage

  • Simple:
var updateUrl = "http://192.168.0.1/version.xml";
window.AppUpdate.checkAppUpdate(onSuccess, onFail, updateUrl);
  • Verbose
var appUpdate = cordova.require('cordova-plugin-app-update.AppUpdate');
var updateUrl = "http://192.168.0.1/version.xml";
appUpdate.checkAppUpdate(onSuccess, onFail, updateUrl);

versionCode

You can simply get the versionCode from typing those code in Console

var versionCode = AppVersion.build
console.log(versionCode)  // 302048
versionName versionCode
0.0.1 18
0.3.4 3048
3.2.4 302048
12.234.221 1436218

server version.xml file

<update>
    <version>302048</version>
    <name>name</name>
    <url>http://192.168.0.1/android.apk</url>
</update>

Platforms

Android only

License

MIT

❄️ 🍻

  • Please let me know if you have any questions.

  • Support me a Star if it is necessary. 👍