MSConversation дает нам локального участника и удаленных участников. Однако я не могу получить отображаемое имя себя или другого. Как получить эти имена? 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)
}
Как и выше, я пытался выполнить поиск в CNContactsStore, UUID из MSConversation отличается от CNContact.