ACAccountStore access not granted

I am developing a sharing extension that will access social media user accounts. I use the following to access the account information of a twitter user:

    let accountStore = ACAccountStore()
    let accountType = accountStore.accountTypeWithAccountTypeIdentifier(ACAccountTypeIdentifierTwitter)
    accountStore.requestAccessToAccountsWithType(accountType, options: nil, completion: { granted, error in
        if granted {
         // do stuff 
        } else {
         // report an error
        }

      

This works in the parent app for the extension, but if I put this code in the window controller for the shared window, the user is asked to grant access to their Twitter accounts. Then it is assigned to false and I get an NSError object with the localized description "Setting TCC failed". What does it mean?

update: after a bit of digging, I found out that TCC.db is a database that stores privacy settings. So in this case I am presented with a dialog asking if I want to grant access, but for some reason an error occurs when granting access. I checked the console for sandboxd messages related to this, but there are none.

+3


source to share





All Articles