Skip to content

Checks whether certain android application is installed and enabled or not

License

Notifications You must be signed in to change notification settings

dexterouschen/cordova-plugin-app-checker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cordova-plugin-app-checker

Checks whether certain android application is enabled or not.

Installation

cordova plugin add cordova-plugin-app-checker

Usage

As this plugin is used to detect the version of an installed app.

API

isAppEnabled(packageName)

It returns a promise which will be resolved to true if the app is enabled and false otherwise.

cordova.plugins.appChecker.isAppEnabled('com.android.chrome')
  .then(function(enabled) { console.log(enabled); })
  .catch(function(error) { console.error(error); });

getAppVersion(packageName)

It returns a promise which will be resolved to the string representation of the version number (eg: 57.0.2987.132) or rejected with a Package is not found error if the app is not installed

cordova.plugins.appChecker.getAppVersion('com.android.chrome')
  .then(function(version) { console.log(version); })
  .catch(function(error) { console.error(error); });

openGooglePlayPage(packageName)

A helper function to open the Google Play page of app. Useful for prompting the user to update/enable the app.

cordova.plugins.appChecker.openGooglePlayPage('com.android.chrome')
  .then(function() { console.log('Google Play page of app has been opened.'); })
  .catch(function(error) { console.error(error); });

About

Checks whether certain android application is installed and enabled or not

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 74.1%
  • JavaScript 25.9%