This plugin allows you to check if an app is installed on the user's device.
It requires an URI Scheme (e.g. comgooglemaps://) on iOS or a Package Name (e.g com.google.android.apps.maps) on Android.
- iOS
- Android
The Cordova CLI is the recommended way to install, see The Command-line Interface.
$ cordova plugin add https://github.com/byteworks-ch/cordova-plugin-app-launcher.git --save
Prepare and compile your project:
$ cordova prepare
$ cordova build
On iOS it is required to add the url schemes that you want to check to the whitelist.
Simply open your app's .plist (usually platforms/ios/<appname>/<appname>-Info.plist)
with an editor and add the following code with your needed Schemes.
<key>LSApplicationQueriesSchemes</key>
<array>
<string>comgooglemaps</string>
<string>maps</string>
</array>
appLauncher.checkUrl(
'comgooglemaps://',
function() {
console.log('Google Maps is available');
},
function() {
console.log('Google Maps is not available');
}
);
appLauncher.checkUrl(
'com.google.android.apps.maps',
function(info) {
// Info parameter is available only for android
console.log('Google Maps is available. Version: ', info.version);
},
function() {
console.log('Google Maps is not available');
}
);