Skip to content

Add openContactsPicker to edit the limited contacts selection on iOS 18+#985

Open
pablogdcr wants to merge 3 commits into
zoontek:masterfrom
pablogdcr:feat/open-contacts-picker
Open

Add openContactsPicker to edit the limited contacts selection on iOS 18+#985
pablogdcr wants to merge 3 commits into
zoontek:masterfrom
pablogdcr:feat/open-contacts-picker

Conversation

@pablogdcr

@pablogdcr pablogdcr commented Jun 10, 2026

Copy link
Copy Markdown

Summary

iOS 18 added limited contacts access. This adds openContactsPicker() to let the user update their selection when the Contacts permission is limited, same as openPhotoPicker() does for the photo library (related: #894, #895).

Apple only exposes this picker as a SwiftUI modifier (contactAccessPicker), so the Contacts handler gets a small Swift file presenting it through a UIHostingController. The ObjC handler calls it via NSClassFromString + a protocol, which works the same with static libs and use_frameworks! without touching the module setup. setup.rb now globs *.swift and links ContactsUI, and the podspec declares swift_version.

Test Plan

Tested in the example app on an iPhone 16 Pro simulator (iOS 18.6), with both the default pod install and USE_FRAMEWORKS=dynamic.

What's required for testing (prerequisites)?

An iOS 18+ simulator. Contacts is already enabled in the example Podfile.

What are the steps to test it (after prerequisites)?

  • Request CONTACTS and pick "Select Contacts" → status is limited
  • Tap the new toolbar button → the contact access picker opens, edit the selection, tap Done → the promise resolves
  • With full access, denied or not determined → rejects with "Contacts permission isn't limited"
  • On iOS < 18 → rejects with "Only available on iOS 18 or higher"
  • On Android → throws the JS "Only supported by iOS 18 and above" error

Compatibility

OS Implemented
iOS
Android

Checklist

  • I have tested this on a device and a simulator (simulator only)
  • I added the documentation in README.md
  • I added a sample use of the API in the example project (example/App.tsx)

@pablogdcr pablogdcr requested a review from zoontek as a code owner June 10, 2026 08:26
@pablogdcr pablogdcr force-pushed the feat/open-contacts-picker branch from 8d8f5d9 to c7c7688 Compare June 10, 2026 08:36
Comment thread ios/Contacts/RNPermissionsContactsPicker.swift Outdated
Comment thread ios/Contacts/RNPermissionHandlerContacts.mm Outdated
Comment thread ios/Contacts/RNPermissionsContactsPicker.swift Outdated
Comment thread android/src/main/java/com/zoontek/rnpermissions/RNPermissionsModuleImpl.kt Outdated
Matches openPhotoPicker and the native CNContactPickerViewController naming.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants