1 | /**
|
2 | * @name AppUpdate
|
3 | * @description
|
4 | * This plugin does self-update for android
|
5 | *
|
6 | * @usage
|
7 | *
|
8 | * You should first host an XML file on your server with the following data in it:
|
9 | * ```xml
|
10 | * <update>
|
11 | * <version>302048</version>
|
12 | * <name>APK Name</name>
|
13 | * <url>https://your-remote-api.com/YourApp.apk</url>
|
14 | * </update>
|
15 | * ```
|
16 | *
|
17 | * Then use the following code:
|
18 | *
|
19 | * ```
|
20 | * import { AppUpdate } from 'ionic-native';
|
21 | *
|
22 | * let updateUrl = 'http://your-remote-api.com/update.xml';
|
23 | *
|
24 | * AppUpdate.checkAppUpdate(updateUrl);
|
25 | * ```
|
26 | *
|
27 | * The plugin will compare the app version and update it automatically if the API has a newer version to install.
|
28 | */
|
29 | export declare class AppUpdate {
|
30 | /**
|
31 | * Check and update
|
32 | * @param updateUrl {string} update api url
|
33 | * @return {Promise<any>} Returns a promise that resolves when something happens
|
34 | */
|
35 | static checkAppUpdate(updateUrl: string): Promise<any>;
|
36 | }
|