Get notified on 'Selected Contacts' updates

Is there a way for the application to get notified when user updates their 'Selected Contacts' from the Settings app when the Contacts permission on the application is set to the new iOS 18 CNAuthorizationStatusLimited status?

My logic already listens for the CNContactStoreDidChangeNotification notification, but it doesn't look like it is being fired under this scenario.

Do we have to setup a new CNChangeHistoryFetchRequest every time the application becomes active and compare the result? Is the value of the currentHistoryToken updated when user selects / deselects entries from their 'Selected Contacts'?

Answered by DTS Engineer in 796015022

This is the expected behavior when your app has a limited authorization status. CNChangeHistoryFetchRequest always returns a reset.

Update

Just noticed that when the user adds contacts to their 'Selected Contacts' list, the application gets killed by the OS, so that's solved.

When they remove contacts from that list though, the OS doesn't kill the application, so the logic will still display and allow user to interact with contacts that they have since disallowed.

I have also noticed that if I issue a CNChangeHistoryFetchRequest when the application becomes active after the user has removed some of their 'Selected Contacts', then the CNFetchResult will include as many CNChangeHistoryAddContactEvent as the contacts that are allowed after the removal. The value of the currentHistoryToken property does not change.

Is this the proper way of detecting deletions on the 'Selected Contacts' list?

This is the expected behavior when your app has a limited authorization status. CNChangeHistoryFetchRequest always returns a reset.

Get notified on 'Selected Contacts' updates
 
 
Q