From 13484f98432fa105dee1d8b9228f1d959c613de5 Mon Sep 17 00:00:00 2001 From: Ibby Date: Wed, 1 Mar 2017 20:33:21 -0500 Subject: [PATCH] docs(app-update): add docs --- src/plugins/app-update.ts | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) 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 {