MSConversation gives us the local participant and remote participants. However, I am unable to retrieve the display name of self or other. How do I get these names? https://developer.apple.com/reference/messages/msconversation
let ids = activeConversation?.remoteParticipantIdentifiers
let otherId = ids?[0].uuidString
let ownId = activeConversation?.localParticipantIdentifier.uuidString
let predicate = CNContact.predicateForContacts(withIdentifiers: [otherId!]);
do {
let contacts = try CNContactStore().unifiedContacts(matching: predicate, keysToFetch: [CNContactFamilyNameKey, CNContactGivenNameKey, CNContactNicknameKey, CNContactIdentifierKey])
for contact in contacts{
print(contact.givenName)
print(contact.familyName)
print(contact.identifier)
}
} catch let err{
print(err)
}
As above I have tried to search CNContactsStore, the UUID from MSConversation is different from CNContact.