Skip to content

Commit

Permalink
feat(plugin): add functionality to app-availablity plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ihadeed committed Mar 6, 2016
1 parent 3d188e1 commit bc4dcaa
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/plugins/appavailability.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<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) => {});
}

}

0 comments on commit bc4dcaa

Please sign in to comment.