1.0.6 • Published 3 years ago
react-native-immediate-phone-call-srijan v1.0.6
react-native-immediate-phone-call-srijan
Getting started
$ npm install react-native-immediate-phone-call-srijan --save
Mostly automatic installation
$ react-native link react-native-immediate-phone-call-srijan
Manual installation
iOS
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜react-native-immediate-phone-call-srijan
and addRNReactNativeImmediatePhoneCallSrijan.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNReactNativeImmediatePhoneCallSrijan.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Run your project (
Cmd+R
)<
Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.reactlibrary.RNReactNativeImmediatePhoneCallSrijanPackage;
to the imports at the top of the file - Add
new RNReactNativeImmediatePhoneCallSrijanPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-immediate-phone-call-srijan' project(':react-native-immediate-phone-call-srijan').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-immediate-phone-call-srijan/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-immediate-phone-call-srijan') ``` 4.For cal permission add this line to manifest.xml in your project for requesting permission of making call <uses-permission android:name="android.permission.CALL_PHONE" />
5.add initent-filter under the activity in mainfest.xml file for your project
Usage
import RNReactNativeImmediatePhoneCallSrijan from 'react-native-immediate-phone-call-srijan';
// TODO: What to do with the module?
const App = () => {
return (
<View >
<Text >
Call to : +915234567890
</Text>
<TouchableOpacity
onPress={() => RNReactNativeImmediatePhoneCallSrijan.immediatePhoneCall("+915234567890")}
>
<Text>Call</Text>
</TouchableOpacity>
</View>
);
};