react-native-anroid-intent-launcher
call native function startActivity
in react-native
isPackageInstalled and isAppInstalled method is to check to see if the app is installed openApp and startAppByPackageName method will run the app when it is installed.
Why Fork
Original Repository is react-native-intent-launcher
Fixes the following issues when building React Native 0.60 or later.
And
Added isPackageInstalled, openApp method
Use isPackageInstalled method when isAppInstalled method doesn't work.
Use openApp method when startAppByPackageName method doesn't work.
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
Description
You can call native function startActivity
in react-native to do something with Intent
which can only be solved with android native code
Installation
Using yarn (RN 0.60 and and above)
yarn add react-native-android-intent-launcher
Using yarn (RN 0.59 and and below)
yarn add react-native-android-intent-launcherreact-native link react-native-android-intent-launcher
Usage
... IntentLauncher // check if app is installed by package nameIntentLauncher ; // open another app by package nameIntentLauncher ; const downloadURL = "https://www.your.com/download" IntentLauncher ...
Properties
action
Stringdata
Stringcategory
Stringflags
Stringextra
ObjectpackageName
StringclassName
Stringflags
Number
In the IntentConstant
, we provide some constants for these properties, you can look up document provided by google to find out property we didn't support currently.
License
MIT