-
Notifications
You must be signed in to change notification settings - Fork 65
feat(contacts): add support for iOS 18 limited contact access #137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat(contacts): add support for iOS 18 limited contact access #137
Conversation
- Updated permissions handling to recognize and support the new `.limited` authorization status introduced in iOS 18. - Integrated `CNContactPickerViewController` to handle contact selection, including the ability to select multiple contacts. - Added support for fetching and returning contacts when the user grants limited access, ensuring proper data flow with the new privacy model. - Refactored permission request flow to handle new iOS 18 privacy features for contact access.
public func contactPicker(_ picker: CNContactPickerViewController, didSelect contacts: [CNContact]) { | ||
let call = self.bridge?.savedCall(withID: self.pickContactCallbackId ?? "") | ||
|
||
guard let call = call else { | ||
return | ||
} | ||
|
||
var contactsArray: [JSObject] = [] | ||
for selectedContact in contacts { | ||
let contact = ContactPayload(selectedContact.identifier) | ||
contact.fillData(selectedContact) | ||
contactsArray.append(contact.getJSObject()) | ||
} | ||
|
||
call.resolve([ | ||
"contacts": contactsArray | ||
]) | ||
|
||
self.bridge?.releaseCall(call) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this related to the new limited permission? Adding the new permission state should be enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok thanks, I will try if it works without this one.
Co-authored-by: Robin Genz <[email protected]>
@daniloargentiero can you re-request a review from @robingenz ? |
.limited
authorization status introduced in iOS 18.CNContactPickerViewController
to handle contact selection, including the ability to select multiple contacts.