diff --git a/src/plugins/app-update.ts b/src/plugins/app-update.ts index 4782c476f..181075216 100644 --- a/src/plugins/app-update.ts +++ b/src/plugins/app-update.ts @@ -6,21 +6,33 @@ import { Plugin, Cordova } from './plugin'; * This plugin does self-update for android * * @usage + * + * You should first host an XML file on your server with the following data in it: + * ```xml + * + * 302048 + * APK Name + * https://your-remote-api.com/YourApp.apk + * + * ``` + * + * Then use the following code: + * * ``` * import { AppUpdate } from 'ionic-native'; * - * let updateUrl = 'http://your-remote-api'; - * AppUpdate.checkAppUpdate(updateUrl) - * .then((something: any) => doSomething(something)) - * .catch((error: any) => console.log(error)); + * let updateUrl = 'http://your-remote-api.com/update.xml'; + * + * AppUpdate.checkAppUpdate(updateUrl); * ``` + * + * The plugin will compare the app version and update it automatically if the API has a newer version to install. */ @Plugin({ pluginName: 'AppUpdate', plugin: 'cordova-plugin-app-update', pluginRef: 'AppUpdate', repo: 'https://github.com/vaenow/cordova-plugin-app-update', - install: 'ionic plugin add cordova-plugin-app-update --save', platforms: ['Android'] }) export class AppUpdate {