mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-04-24 03:40:17 +08:00
feat(plugin): add functionality to app-availablity plugin
This commit is contained in:
parent
3d188e1f31
commit
bc4dcaae53
@ -17,4 +17,19 @@ import {Plugin, Cordova} from './plugin';
|
|||||||
})
|
})
|
||||||
export class AppAvailability {
|
export class AppAvailability {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if an app is available on device
|
||||||
|
* @param app Package name on android, or URI scheme on iOS
|
||||||
|
* @returns {Promise<boolean>}
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
static check(app : string) : Promise<any> {
|
||||||
|
// This Promise is replaced by one from the @Cordova decorator that wraps
|
||||||
|
// the plugin's callbacks. We provide a dummy one here so TypeScript
|
||||||
|
// knows that the correct return type is Promise, because there's no way
|
||||||
|
// for it to know the return type from a decorator.
|
||||||
|
// See https://github.com/Microsoft/TypeScript/issues/4881
|
||||||
|
return new Promise<boolean>((res, rej) => {});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user