Skip to content

Mrunal-dethekar/react-native-upi-app-detector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

react-native-upi-app-detector

Detect which specific popular UPI payment apps are installed on Android and iOS devices. This library is pre-configured to detect PhonePe, Google Pay, Paytm, BHIM, and CRED.

Installation

npm install react-native-upi-app-detector

Configuration

Expo (Recommended)

If you are using Expo, simply add the plugin to your app.json or app.config.js. The plugin automatically handles the required LSApplicationQueriesSchemes for iOS.

{
  "expo": {
    "plugins": ["react-native-upi-app-detector"]
  }
}

iOS (Bare React Native)

You must add the UPI app schemes to your Info.plist inside the <dict> block to allow querying for installed apps:

<key>LSApplicationQueriesSchemes</key>
<array>
  <string>phonepe</string>
  <string>tez</string>
  <string>paytmmp</string>
  <string>bhim</string>
  <string>credpay</string>
</array>

Android

No manual configuration is required. The library automatically merges the necessary <queries> into your AndroidManifest.xml.

Usage

import { getUPIApps } from 'react-native-upi-app-detector';
import type { UPIAppResult } from 'react-native-upi-app-detector';

// ...

const checkApps = async () => {
  const apps: UPIAppResult[] = await getUPIApps();

  apps.forEach((app) => {
    if (app.isPresent) {
      console.log(`${app.appName} is installed!`);
    }
  });
};

API Reference

getUPIApps()

Returns a promise that resolves to an array of UPIAppResult objects.

UPIAppResult Type

Property Type Description
appName string Human-readable name (e.g., "PhonePe")
identifier string Short identifier (e.g., "phonepe", "gpay")
androidPackage string Android package name
iosScheme string iOS URL scheme
isPresent boolean Whether the app is installed on the device

Supported Apps

The library currently detects the following UPI apps:

  • PhonePe
  • Google Pay (Tez)
  • Paytm
  • BHIM
  • CRED

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

About

React Native library to detect installed UPI apps on Android and iOS.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors