react-native-verify-installer
v1.1.2
Published
Verify android package by installer. Can determine if app installed Play Store, Amazon Store or 3rd party
Downloads
1
Maintainers
Readme
react-native-verify-installer
Android only React Native library to retrieve the source of installation for a given package name
Getting started
$ npm install react-native-verify-installer --save
Automatic installation
$ react-native link react-native-verify-installer
Manual installation
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
com.vacuumdecay.verifypackage.RNVerifyInstallerPackage;
to the imports at the top of the file - Add
new RNVerifyInstallerPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-verify-installer' project(':react-native-verify-installer').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-verify-installer/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:implementation project(':react-native-verify-installer')
Usage
import VerifyInstaller from 'react-native-verify-installer';
VerifyInstaller.getInstallerSource("com.android.chrome", source => {
console.log(source);//Will return one of ['Play Store','Amazon Appstore','ADB','Unknown']
});