npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

expo-check-installed-apps

v0.2.6

Published

Expo Package to check the installed apps in android and ios

Downloads

349

Readme

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!