1 | /**
|
2 | * @name App Availability
|
3 | * @description
|
4 | * 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.
|
5 | *
|
6 | * Requires Cordova plugin: cordova-plugin-appavailability. For more info, please see the [AppAvailability plugin docs](https://github.com/ohh2ahh/AppAvailability).
|
7 | *
|
8 | * @usage
|
9 | * ```typescript
|
10 | * import { AppAvailability, Device } from 'ionic-native';
|
11 | *
|
12 | *
|
13 | * let app;
|
14 | *
|
15 | * if (Device.platform === 'iOS') {
|
16 | * app = 'twitter://';
|
17 | * } else if (Device.platform === 'Android') {
|
18 | * app = 'com.twitter.android';
|
19 | * }
|
20 | *
|
21 | * AppAvailability.check(app)
|
22 | * .then(
|
23 | * (yes: string) => console.log(app + ' is available'),
|
24 | * (no: string) => console.log(app + ' is NOT available')
|
25 | * );
|
26 | * ```
|
27 | */
|
28 | export declare class AppAvailability {
|
29 | /**
|
30 | * Checks if an app is available on device
|
31 | * @param {string} app Package name on android, or URI scheme on iOS
|
32 | * @returns {Promise<boolean>}
|
33 | */
|
34 | static check(app: string): Promise<boolean>;
|
35 | }
|