Quantcast
Channel: How to make phone call in React Native? - Stack Overflow
Viewing all articles
Browse latest Browse all 14

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

$
0
0
import React, { Component } from "react";import {Linking,Platform,TouchableOpacity,Text} from "react-native";export default class MakeCall extends Component { dialCall = (number) => {    let phoneNumber = '';    if (Platform.OS === 'android') { phoneNumber = `tel:${number}`; }    else {phoneNumber = `telprompt:${number}`; }    Linking.openURL(phoneNumber); }; Render(){        return(<TouchableOpacity                   style={{                   height: 30,                   width: 30,                   backgroundColor: "#329df4",                   alignItems: "center",                   justifyContent: "center",                   borderRadius: 5                   }}                 onPress={()=>{this.dialCall(123456789)}}><Text>Phone</Text></TouchableOpacity>              )  }}

Viewing all articles
Browse latest Browse all 14

Trending Articles



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