App updater for Cordova/PhoneGap
Try it yourself:
Just clone and install this demo. cordova-plugin-app-update-DEMO 🎉
cordova plugin add cordova-plugin-app-update
- 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);
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 |
<update>
<version>302048</version>
<name>name</name>
<url>http://192.168.0.1/android.apk</url>
</update>
Android only
MIT
-
Please let me know if you have any questions.
-
Support me a
Star
if it is necessary. 👍