Skip to content

Commit bff1bb8

Browse files
committed
allow configuring the prompt option of callPhone
1 parent 879ef3b commit bff1bb8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

source/views/components/call-phone.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@
33
import {Alert, Clipboard} from 'react-native'
44
import {phonecall} from 'react-native-communications'
55

6-
export function callPhone(phoneNumber: string) {
6+
type Options = {|
7+
prompt?: boolean,
8+
|}
9+
10+
export function callPhone(phoneNumber: string, opts?: Options) {
11+
const {prompt = true} = opts || {}
712
try {
8-
phonecall(phoneNumber, true)
13+
phonecall(phoneNumber, prompt)
914
} catch (err) {
1015
Alert.alert(
1116
"Apologies, we couldn't call that number",

0 commit comments

Comments
 (0)