I understand how to ask for Twitter access using:
requestAccessToAccountsWithType:withCompletionHandler
:
But this pops a dialogue if the app isn't authorised. How can I silently check to see if the app is authorised?
I can check the number of accounts using:
NSArray *twitterAccounts = [store accountsWithAccountType:twitterAccountType];
But I will get an empty array back if I the app is not authorized AND if there are no accounts available. I can't see a way of finding out which of these is the case.
To clarify I need to tell the difference between the following cases:
- A user has not granted the application permission to use Twitter.
- A user has granted permission but has not set up any Twitter accounts.
There is also TWTweetComposeViewController canSendTweet
which will return true if The app is authorised AND there is at least one account setup. However, again this doesn't give me the ability to tell the difference between the two cases if it returns false.