Contacts Framework Question

Hey, I would love to access the users Contact (ie. the Me Card) Apple recently released the Invites app and within this app you can find the users Contacts Photo. I tried to replicate this behaviour but I currently need to match based on a name or email or something else. I have no idea how to receive this data because when using the Invites app I only remember the app asking for Contacts permission and nothing else so far.

let store = CNContactStore()
            let keysToFetch = [CNContactImageDataAvailableKey, CNContactImageDataKey, CNContactThumbnailImageDataKey] as [CNKeyDescriptor]
            let email = "test@test.de"
            
            let predicate = CNContact.predicateForContacts(matchingEmailAddress: email)
            do {
                let contacts = try store.unifiedContacts(matching: predicate, keysToFetch: keysToFetch)
                let imageDatas: [Data] = contacts.compactMap { $0.imageData }
                
                self.images = imageDatas.map { UIImage(data: $0) ?? UIImage() }
                
            } catch {
                print("Error fetching contacts: \(error)")
            }

This is how I am retrieving the Image. MAYBE someone can help me out.

Thank you so far

~ Flo

I would love to access the users Contact (ie. the Me Card)

There is no Me Card API available on iOS. If you would like for Apple to consider adding support for such features, please submit your suggestion request via Feedback Assistant (https://feedbackassistant.apple.com).

his is how I am retrieving the Image

After the user grants contacts access to your app, the app can fetch image properties.

Contacts Framework Question
 
 
Q