@yz1311/react-native-intent-launcher
v0.3.5
Published
call native function about intent in react-native android
Readme
react-native-intent-launcher
call native function startActivity in react-native
Support Android 7 FileProvider
thanks poberwong's workreact-native-intent-launcher AndroidUtilCode
Description
You can call native function startActivity in react-native to do something with Intent which can only be solved with android native code
Compatibility
| @yz1311/react-native-intent-launcher version | Required React Native Version |
|----|-----|
|0.2.x|>=0.60 or >=0.59 if using [Jetifier]|
|0.1.x|<=0.59|
Installation
npm install @yz1311/react-native-intent-launcher --savereact-native link react-native-intent-launcher
Usage startActivity
import IntentLauncher, { IntentConstant } from 'react-native-intent-launcher'
...
IntentLauncher.startActivity({
action: 'android.settings.APPLICATION_DETAILS_SETTINGS',
data: 'package:com.example'
})
...you can view the code in Example of the Repository
Properties
actionStringdataStringcategoryStringtypeStringextraObjectpackageNameStringclassNameStringflagsNumber (to set multi flgas,eg: flag1|flag2|flag2)
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.
Usage finish
to finish a exist activity
import IntentLauncher, { IntentConstant } from 'react-native-intent-launcher'
...
IntentLauncher.finish(0,'',{}); //if no resultCode,just like this
...References
License
MIT
