Yet another react-native package
npm install react-native-android-appcheckTool to check for install status of apps on Android
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).
- Android:
- Testing functionality
- iOS:
- No support planned
- react-native:
- supported versions ">= 0.60.5"
with react-native ">=0.60.5"$3- Modify `` dependencies { $3$ npm i react-native-android-appcheck -S |
Android | iOS
:---------------------------------------------:|:---------------------------------------------:
??? | ???
`jsx
import checkPackage from 'react-native-android-appcheck'
(async function() {
const isInstalled = await checkPackage('com.chat.fakeapp');
console.log(App is installed: ${isInstalled});``
}());
| prop | type | default | desc |
|---|---|---|---|
| packageName | string | none | Android package name |