Sorting Contacts

I am using the Contacts API for my iOS app to fetch contacts. I currently sort the fetched contacts alphabetically, but was wondering if there is any ability to rank and sort them by "highest interaction" (i.e. scan iMessage or phone call log to prioritize contacts)?

Any insight would be appreciated. I don't think this is possible via the Contacts API from what I've read, and I haven't found any existing answer commenting on this.

Just by looking at the current Contacts API, I don't think this is possible. The CNContact class doesn't have a value for interaction, and the CNContactSortOrder class doesn't give that option either. Apple doesn't let apps see iMessage history or call logs (for privacy reasons). Maybe adding an option for the user to favorite contacts they interact with the most would give a similar function?

Sorting Contacts
 
 
Q