Quantcast
Viewing latest article 5
Browse Latest Browse All 14

Answer by Codemaker for How to make phone call in React Native?

1. install react-native-phone-call package using npm

$ npm install --save react-native-phone-call

2. create a method called makeCall()

makeCall = (number) => {     const args = {         number: number, // String value with the number to call         prompt: true // Optional boolean property. Determines if the user should be prompt prior to the call      }    call(args).catch(console.error)}

3. call the method in onPress event of a TouchableOpacity

<TouchableOpacity key={index} style={{width: '80%', height: 80, backgroundColor: 'rgb(186, 186, 186)',  alignItems:'center', justifyContent: 'space-between', borderBottomWidth: 0.5, borderBottomColor: '#000000'}}             onPress={()=> this.makeCall(item.contactNumber)}>

Viewing latest article 5
Browse Latest Browse All 14

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>