Phone Number

The ContactPhoneNumber model represents a phone number associated with a contact in the ContactsManager SDK.

Properties

  • phoneId: String - Unique identifier for the phone number entry
  • value: String? - The actual phone number
  • type: String? - The type or label for the phone number (e.g., mobile, work, home)
  • emoji: String? - An emoji icon associated with this phone number
  • contact: Contact? - Reference to the parent contact that owns this phone number

Usage Example

// Create a phone number
let phoneNumber = ContactPhoneNumber(
    contactId: "contact-123",
    value: "+1 (555) 123-4567",
    type: "mobile",
    emoji: "📱"
)

// Add to a contact
contact.phoneNumbers.append(phoneNumber)

// Access from a contact
if let firstPhoneNumber = contact.phoneNumbers.first {
    print("Phone: \(firstPhoneNumber.value ?? "None") (\(firstPhoneNumber.type ?? "Unknown"))")
}