docs(plugin): add docs and usage

This commit is contained in:
Ibrahim Hadeed 2016-03-06 15:39:09 -05:00
parent bc4dcaae53
commit 80e7eedcae

View File

@ -1,6 +1,8 @@
import {Plugin, Cordova} from './plugin';
/**
* This plugin allows you to check if an app is installed on the user's device. It requires an URI Scheme (e.g. twitter://) on iOS or a Package Name (e.g com.twitter.android) on Android.
*
* Requires Cordova plugin: cordova-plugin-appavailability. For more info, please see the [AppAvailability plugin docs](https://github.com/ohh2ahh/AppAvailability).
*
* ```
@ -9,6 +11,19 @@ import {Plugin, Cordova} from './plugin';
*
* @usage
* ```js
* var app;
*
* if(device.platform === 'iOS') {
* app = 'twitter://';
* }else if(device.platform === 'Android'){
* app = 'com.twitter.android';
* }
*
* AppAvailability.check(app)
* .then(
* yes => console.log(app + " is available"),
* no => console.log(app + " is NOT available")
* );
* ```
*/
@Plugin({