0.1.2 • Published 10 months ago

expo-android-check-installed-apps v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

expo-android-check-installed-apps

An Expo module config plugin to check installed app existance in android

API documentation

Installation in managed Expo projects

For managed Expo projects, please follow the installation instructions in the API documentation for the latest stable release. If you follow the link and there is no documentation available then this library is not yet usable within managed projects it is likely to be included in an upcoming Expo SDK release.

Installation in bare React Native projects

For bare React Native projects, you must ensure that you have installed and configured the expo package before continuing.

Add the package to your npm dependencies

npm install expo-android-check-installed-apps

Methods

checkInstalledApps

This asynchronous function accepts an array of package names and returns a promise that resolves with an object containing the installation status of each app.

Parameters

  • packageNames (Array<string>): An array of package names (strings) you want to check for installation on the device.

Returns

  • Promise<Record<string, boolean>>: A promise that resolves to an object where the keys are package names and the values are booleans:
    • true: The app with the specified package name is installed.
    • false: The app with the specified package name is not installed.

Example Usage

const packageNames = ["com.google.android.apps.fitness", "com.android.chrome"];

checkInstalledApps(packageNames)
  .then((installedApps) => {
    console.log(installedApps);
    // Output: { "com.google.android.apps.fitness": false, "com.android.chrome": true }
  })
  .catch((error) => {
    console.error("Error checking installed apps:", error);
  });

Example Response

{
  "com.google.android.apps.fitness": false,
  "com.android.chrome": true
}

Contributing

Contributions are very welcome! Please refer to guidelines described in the contributing guide.