sam rafiei
sam rafiei

Reputation: 71

How to make a phone call in react native and place it in the background

I'm trying to make a phone call with react-native and have it automatically be in the background (stay in my app), is it possible to achieve this? also When pressing the button to make the call a prompt pops up saying "call (###)###-####" is there a way around the prompt to make a direct call? thank you.

Upvotes: 0

Views: 3681

Answers (2)

Olaf K
Olaf K

Reputation: 187

I think react-native-callkeep might be more what you're looking for, as it allows you to make calls without leaving your app.

https://github.com/react-native-webrtc/react-native-callkeep

Upvotes: 0

Sucheta Singha
Sucheta Singha

Reputation: 139

You have to run: npm i react-native-phone-call

it's ultimately just a wrapper for:

import {Linking} from 'react-native'
Linking.openURL(`tel:${phoneNumber}`)

<Text onPress={()=>{Linking.openURL('tel:${phoneNumber}`);} }>${phoneNumber}`</Text>

Check this link: https://www.npmjs.com/package/react-native-phone-call

Upvotes: 1

Related Questions