CNContactProperty: identifier property
The identifier property is the identifier of the selected entry when the selection is one entry of a labeled value (one particular phone number or email address).
Value
A string, or null.
- When the selection is one entry of a labeled value, it equals the
identifierof that entry'sCNLabeledValue. - Otherwise
null. - Read-only. Assigning to it throws
TypeError. - The value never changes, so there is no change event.
Examples
js
const picker = new CNContactPickerViewController();
picker.addEventListener('contactpropertyselect', (event) => {
console.log(event.contactProperty.identifier);
});Effect: when the user taps a phone number, logs that entry's identifier (a string).
Corresponding iOS API
CNContactProperty.identifier.