I’m using React Native Expo, and I want to open the default phone Contacts app.
On Android, I used:
await Linking.openURL("content://contacts/people/");
and that’s worked.
On iOS that doesn’t work.
I tried:
await Linking.openURL('contacts://');
but it doesn’t work.
How to do that on IOS?
2
Answers
To open the default dialer app on iOS without a number pre-filled, you can try using the
telprompt://{your number}
URL scheme, which should prompt the dialer to open without immediately initiating a call. Here’s how you might use it in React Nativelinking never worked for me either so I now use react-native-contacts. I believe it’s due to new android policies with permissions, as it has been disallowing a lot of things unless user has authorized, unlike < api level 32
You need to first install the package using "npm install react-native-contacts" or "yarn add react-native-contacts" and then follow my steps below. (remember, you will need to ask for user’s permission"
First check for permissions
Now if the user authorizes, you can either follow my example below, or do as you please