README
react-native-android-appcheck
Tool to check for install status of apps on Android
Why?
Linking.canOpenURL
works well for "Deep Links" with custom schema (e.g. exampleapp://
), however it is less useful when an app only implements "App Links" with domain verification (i.e. android:autoVerify="true"
). See this Android documentation page: https://developer.android.com/training/app-links/verify-site-associations#the-difference
Since a browser is capable of opening general HTTPS URLs, Linking.canOpenURL('https://applink.exampleapp.com')
will always return true, whether or not "exampleapp" is installed.
One real-world example of this is Apple Music on Android. On iOS, the music://
schema can be queried for, but on Android (>= 6.0), only an "app link" is available. In this case, custom schemas are present, but the autoVerify
attribute 'locks' the intent-filter to the https domains. Android versions lower than 6.0 are probably still able to query for the custom schemes (autoVerify implemented in 6.0/Marshmallow).
Status
- Android:
- Testing functionality
- iOS:
- No support planned
- react-native:
- supported versions ">= 0.60.5"
Installation
with react-native ">=0.60.5"0. Setup Swift and Kotlin
1. Install latest version from npm
|
Demo
Android | iOS |
---|---|
??? | ??? |
Example
import checkPackage from 'react-native-android-appcheck'
(async function() {
const isInstalled = await checkPackage('com.chat.fakeapp');
console.log(`App is installed: ${isInstalled}`);
}());
Reference
prop | type | default | desc |
---|---|---|---|
packageName | string |
none | Android package name |