So, the problem: When using the Event Kit framework and requesting access to the user's calendar database on OSX the panel that asks the user for permission is only presented the first time -requestAccessToEntityType:Completion: is called. This makes it hard to test the application's response when the user denies permission, or even when the user initially grants permission(in other words, to re-create first-run conditions). This user scenario could be replicated if there were a way to reset the EKAuthorizationStatus to EKAuthorizationStatusNotDetermined, but as far as I can tell, once the initial permission decision has been made there is no going back to the NotDetermined status.
I have read the iOS solution posted here: Is it possible to reset the privacy settings in iOS? but I cannot find a similar solution for OSX.
The question: Is there a way to simulate the first-run of an application that is requesting access to the user's calendar database, such that the permission dialogue is presented repeatedly for testing purposes?
The permission flags are stored within a SQLite db:
~/Library/Application Support/com.apple.TCC/TCC.db
In the access
table you should see the column service
and kTCCServiceAddressBook
, etc. along with client
to any corresponding apps that have permission, or at some point requested it.
If you want to test the functionality to request permission again is to delete the row which contains the application name — next time you launch it you should get the request again.
You can verify the permissions by:
System Preferences > Security & Privacy > Privacy