Building apps at a large company? Check out Ionic Enterprise

App Availability

Improve this doc

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.

Repo: https://github.com/ohh2ahh/AppAvailability

Installation

  1. Install the Cordova and Ionic Native plugins:
    $ ionic cordova plugin add cordova-plugin-appavailability
    $ npm install --save @ionic-native/app-availability
    
  2. Add this plugin to your app's module

Supported platforms

Usage

import { AppAvailability } from '@ionic-native/app-availability';
import { Platform } from 'ionic-angular';

constructor(private appAvailability: AppAvailability, private platform: Platform) { }

...

let app;

if (this.platform.is('ios')) {
  app = 'twitter://';
} else if (this.platform.is('android')) {
  app = 'com.twitter.android';
}

this.appAvailability.check(app)
  .then(
    (yes: string) => console.log(app + ' is available'),
    (no: string) => console.log(app + ' is NOT available')
  );

Instance Members

check(app)

Checks if an app is available on device

Param Type Details
app string

Package name on android, or URI scheme on iOS

Returns: Promise<boolean>

API

Native

General