From bc4dcaae535b12a2c2a62f44d7d894c2d99bb598 Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Sun, 6 Mar 2016 15:35:59 -0500 Subject: [PATCH] feat(plugin): add functionality to app-availablity plugin --- src/plugins/appavailability.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/plugins/appavailability.ts b/src/plugins/appavailability.ts index 73f312299..52cd1510c 100644 --- a/src/plugins/appavailability.ts +++ b/src/plugins/appavailability.ts @@ -17,4 +17,19 @@ import {Plugin, Cordova} from './plugin'; }) export class AppAvailability { + /** + * Checks if an app is available on device + * @param app Package name on android, or URI scheme on iOS + * @returns {Promise} + */ + @Cordova() + static check(app : string) : Promise { + // 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((res, rej) => {}); + } + }