mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-03-13 06:01:04 +08:00
docs(app-update): add docs
This commit is contained in:
parent
91ee5bde5f
commit
13484f9843
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user