This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.

Expo Contacts (legacy) iconExpo Contacts (legacy)

A library that provides access to the phone's system contacts.

Android
iOS
Included in Expo Go
Recommended version:
~56.0.14

expo-contacts provides access to the device's system contacts, allowing you to get contact information as well as adding, editing, or removing contacts.

On iOS, contacts have a multi-layered grouping system that you can also access through this API.

Installation

Terminal
- npx expo install expo-contacts
- yarn expo install expo-contacts
- pnpm expo install expo-contacts
- bun expo install expo-contacts

If you are installing this in an existing React Native app, make sure to install expo in your project.

Configuration in app config

You can configure expo-contacts using its built-in config plugin if you use config plugins in your project (Continuous Native Generation (CNG)). The plugin allows you to configure various properties that cannot be set at runtime and require building a new app binary to take effect. If your app does not use CNG, then you'll need to manually configure the library.

Example app.json with config plugin

app.json
{ "expo": { "plugins": [ [ "expo-contacts", { "contactsPermission": "Allow $(PRODUCT_NAME) to access your contacts." } ] ] } }

Configurable properties

NameDefaultDescription
contactsPermission"Allow $(PRODUCT_NAME) to access your contacts"
Only for: 
iOS

A string to set the NSContactsUsageDescription permission message.

Are you using this library in an existing React Native app?

If you're not using Continuous Native Generation (CNG) (you're using native android and ios projects manually), then you need to configure following permissions in your native projects:

  • For Android, add android.permission.READ_CONTACTS and android.permission.WRITE_CONTACTS permissions to your project's android/app/src/main/AndroidManifest.xml:

    <uses-permission android:name="android.permission.READ_CONTACTS" /> <uses-permission android:name="android.permission.WRITE_CONTACTS" />
  • For iOS, add the NSContactsUsageDescription key to your project's ios/[app]/Info.plist:

    <key>NSContactsUsageDescription</key> <string>Allow $(PRODUCT_NAME) to access your contacts</string>

Usage

Basic Contacts Usage
import { useEffect } from 'react'; import { StyleSheet, View, Text } from 'react-native'; import * as Contacts from 'expo-contacts/legacy'; export default function App() { useEffect(() => { (async () => { const { status } = await Contacts.requestPermissionsAsync(); if (status === 'granted') { const { data } = await Contacts.getContactsAsync({ fields: [Contacts.Fields.Emails], }); if (data.length > 0) { const contact = data[0]; console.log(contact); } } })(); }, []); return ( <View style={styles.container}> <Text>Contacts Module Example</Text> </View> ); } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#fff', alignItems: 'center', justifyContent: 'center', }, });

API

import * as Contacts from 'expo-contacts/legacy';

No API data file found, sorry!

Permissions

Android

This library automatically adds READ_CONTACTS and WRITE_CONTACTS permissions to your app:

Android permissionDescription

READ_CONTACTS

Allows an application to read the user's contacts data.

WRITE_CONTACTS

Allows an application to write the user's contacts data.

iOS

The following usage description keys are used by this library:

Info.plist keyDescription

NSContactsUsageDescription

A message that tells the user why the app is requesting access to the user’s contacts.