Make phone call from React-native

Hi guys, In this article, we are going to learn about How to make phone call from React-native, In my last post I have explained how to open WhatsApp chatbox from the react-native application using React-native core library Linking component. In this post, we are using the same core component in this example to make a phone call so let’s start with an example

1. Create a new project

I am using my previous project which I had created to open WhatsApp from React-native application

2. Import the following components

3. Make a call from React-native app

As you see in the above arrow function we have to write platform dependant condition as for Android we have to use tel: XXXXXXXXXX and for iOS telprompt: XXXXXXXXXX and create URL and pass these URL to Linking component in parameter this will open device phone call screen with keypad

4. Full source code

As you can see above code, I have defined the default state for phoneNo in the constructor.

We make a phone call using React-native core component Linking there are other libraries available to make phone calls like react-native-phone-call to install this library please check this post

5. Output

Make phone call from React-native

Make phone call from React-native

Thank you 🙂

Leave a Reply

Your email address will not be published.