docs(app-update): add docs

This commit is contained in:
Ibby 2017-03-01 20:33:21 -05:00
parent 91ee5bde5f
commit 13484f9843

View File

@ -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
* <update>
* <version>302048</version>
* <name>APK Name</name>
* <url>https://your-remote-api.com/YourApp.apk</url>
* </update>
* ```
*
* 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 {