Social Profile

The ContactSocial model represents a social media profile associated with a contact in the ContactsManager SDK.

Properties

  • socialId: String - Unique identifier for the social profile entry
  • urlString: String? - The URL for the social profile
  • username: String? - The username on the social platform
  • userIdentifier: String? - Unique identifier for the user on the platform
  • service: String? - The social media service name (e.g., Twitter, LinkedIn, Instagram)
  • type: String? - The type or category of the social profile
  • emoji: String? - An emoji icon associated with this social profile
  • contact: Contact? - Reference to the parent contact that owns this social profile

Usage Example

// Create a social profile
let socialProfile = ContactSocial(
    contactId: "contact-123",
    urlString: "https://twitter.com/johndoe",
    username: "johndoe",
    userIdentifier: nil,
    service: "Twitter",
    type: "personal",
    emoji: "🐦"
)

// Add to a contact
contact.socialProfiles.append(socialProfile)

// Access from a contact
if let firstSocial = contact.socialProfiles.first {
    print("Social: \(firstSocial.username ?? "") on \(firstSocial.service ?? "Unknown")")
}