Skip to main content

Contacts Authorization

The ContactsManager SDK requires permission to access the user’s device contacts. This guide explains how to request and manage contacts access in your app.

Authorization Status

Check the current authorization status using the contactsAccessStatus property:

Requesting Access

Request access to contacts with the requestContactsAccess() method:

Best Practices for Requesting Access

  1. Explain Why: Before requesting access, explain to users why your app needs contacts access
  2. Request at the Right Time: Only request access when you actually need it
  3. Handle Denial Gracefully: Provide a way for users to enable access later if they initially deny it

Handling Access Denial

When access is denied, the SDK provides a SwiftUI alert that guides users to the Settings app:
You can also check if the settings alert should be shown:

Privacy Configuration

In addition to requesting permission at runtime, you must configure your app’s Info.plist file with a privacy description:
This message will be shown to users when they are prompted for permission.

Complete Authorization Flow Example

Here’s a complete example showing the authorization flow:

Troubleshooting

Common Issues

  1. Permission Dialog Not Showing
    • Verify that you’ve added the NSContactsUsageDescription key to your Info.plist
    • Make sure you’re calling requestContactsAccess() on the main thread
  2. Permission Denied
    • Use the settings alert to guide users to enable access in Settings
    • Explain the benefits of contacts access clearly
  3. Sync Failing After Permission Granted
    • Make sure the SDK is properly initialized
    • Check for network connectivity issues
    • Verify that you’ve registered the contact source