react-native-appchecker
v0.1.4
Published
check third party app installation and open app
Maintainers
Readme
Here’s the revised README.md with the additional note in proper English:
react-native-appchecker
Easily check if a third-party app is installed and launch it directly from your React Native app.
Installation
Install the package using npm:
npm install react-native-appchecker Configuration
For iOS, add the third-party app scheme to your Info.plist:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>third_party_app_schema</string>
</array> Note: To check or open a third-party app on iOS, you must provide the app's scheme. For Android, you need to provide the app's package name.
Usage
Import the AppChecker module in your React Native application:
import AppChecker from 'react-native-appchecker'; Check if a third-party app is installed
const isInstalled = await AppChecker.checkThirdPartyApp('third_party_app_name');
if (isInstalled) {
console.log('App is installed!');
} else {
console.log('App is not installed.');
} Open a third-party app
await AppChecker.openThirdPartyApp('third_party_app_name'); Example
import React from 'react';
import { Button, Alert } from 'react-native';
import AppChecker from 'react-native-appchecker';
const App = () => {
const checkApp = async () => {
const isInstalled = await AppChecker.checkThirdPartyApp('third_party_app_name');
Alert.alert(isInstalled ? 'App is installed!' : 'App is not installed.');
};
const openApp = async () => {
try {
await AppChecker.openThirdPartyApp('third_party_app_name');
} catch (error) {
Alert.alert('Error', 'Could not open the app.');
}
};
return (
<>
<Button title="Check App" onPress={checkApp} />
<Button title="Open App" onPress={openApp} />
</>
);
};
export default App; Contributing
Contributions are welcome! Please check the contributing guide for details on how to contribute to the repository and participate in the development workflow.
License
This project is licensed under the MIT License.
