Skip to content

An expo module config plugin to check installed apps existence in android

Notifications You must be signed in to change notification settings

EndLess728/expo-check-installed-apps

Repository files navigation

Expo Check Installed Apps

A config plugin for Expo to check for the existence of installed apps on Android and iOS.

Note: This library supports Expo SDK 51 and above.


Table of Contents


Installation

You can find the package on npm: expo-check-installed-apps.

Installation in Managed Expo Projects

For managed Expo projects, follow the installation instructions in the API documentation for the latest stable release.

If documentation for managed projects is unavailable, this library may not yet be supported within managed workflows and is likely to be included in an upcoming Expo SDK release.

Installation in Bare React Native Projects

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

Install the package via npm:

npm install expo-check-installed-apps

Setup

Automatic Configuration

If using Expo's prebuild method, you can configure the plugin automatically in your app.json or app.config.js file. Specify the package names and URL schemes for the apps you want to check:

{
  "expo": {
    "plugins": [
      [
        "expo-check-installed-apps",
        {
          "android": ["com.facebook.katana", "com.twitter.android"],
          "ios": ["fb", "twitter"]
        }
      ]
    ]
  }
}

Manual Configuration

If you are not using app.json or app.config.js, you'll need to manually update your native project files.

Android

Add the package names to your AndroidManifest.xml:

<manifest>
    <queries>
        <package android:name="com.facebook.katana"/>
        <package android:name="com.twitter.android"/>
    </queries>
</manifest>

iOS

Add the URL schemes to your Info.plist:

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>fb</string>
    <string>twitter</string>
</array>

API Documentation

checkInstalledApps

Checks whether specific apps are installed on the user's device.

Parameters

  • packageNames (Array<string>):
    An array of package names (for Android) or URL schemes (for iOS) to check.

Returns

  • Promise<Record<string, boolean>>:
    Resolves to an object where keys are package names or URL schemes, and values are booleans:
    • true: App is installed.
    • false: App is not installed.

Example Usage

import { checkInstalledApps } from "expo-check-installed-apps";
import { Platform } from "react-native";

const packageNames: string[] =
  Platform.select({
    android: ["com.google.android.apps.fitness", "com.android.chrome"], // Use package name of android apps
    ios: ["fb://", "twitter://"], // Use proper url scheme of ios apps
  }) || [];

checkInstalledApps(packageNames)
  .then((installedApps) => {
    console.log(installedApps);
  })
  .catch((error) => {
    console.error("Error checking installed apps:", error);
  });

Example Response

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

Contributing

Contributions are welcome!

About

An expo module config plugin to check installed apps existence in android

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •