Tell about new contacts api

Generated on 8/8/2024

1 search

In iOS 18, Apple introduced new APIs to enhance how apps can access and manage contacts. Here are the key points about the new Contacts API:

  1. Limited Access: iOS 18 introduces a new feature called limited access, allowing users to share only a portion of their contacts with an app. This is managed through a two-stage authorization prompt:

    • The first prompt asks whether to share contacts with the app.
    • If the user taps "Continue," a second prompt appears, offering the option to share a specific set of contacts or grant full access.
  2. Contact Access Button: This new API provides a streamlined way for apps to request access to additional contacts directly within the app's UI. It fits seamlessly into the existing UI and allows users to grant access to new contacts with a single tap. This button is particularly useful for apps that need to access contacts incrementally, such as when searching for mail recipients.

  3. Authorization Levels: There are now four authorization levels for contacts:

    • Full Access: The app can read and modify any contact.
    • Limited Access: The app can read and modify only the contacts it has been granted access to.
    • Not Determined: The app has not yet requested access.
    • Denied: The app is not allowed to access contact data.
  4. Contact Access Picker: This API allows users to manage which contacts an app has access to without leaving the app. It provides a more granular control over contact sharing.

  5. CNContactStore: This remains the primary way to access contact data, requiring appropriate authorization. It can fetch contacts and create new entries, and it automatically presents the authorization prompt when needed.

For more detailed information, you can refer to the session Meet the Contact Access Button (02:56).

Relevant Sessions