-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(app-update): add cordova-plugin-app-update support (#1105)
* add new app-update plugin * update plugin info
- Loading branch information
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { Plugin, Cordova } from './plugin'; | ||
|
||
/** | ||
* @name AppUpdate | ||
* @description | ||
* This plugin does self-update for android | ||
* | ||
* @usage | ||
* ``` | ||
* 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)); | ||
* ``` | ||
*/ | ||
@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 { | ||
/** | ||
* Check and update | ||
* @param updateUrl {string} update api url | ||
* @return {Promise<any>} Returns a promise that resolves when something happens | ||
*/ | ||
@Cordova({ | ||
callbackOrder: 'reverse' | ||
}) | ||
static checkAppUpdate(updateUrl: string): Promise<any> { return; } | ||
} | ||
|