I'm using the code below to access the user's twitter account. The UIAlert only ever pops up once on any given device. It seems that this is a one-time access request, and once granted or denied, you have to go into 'Settings' to change it.
Obviously, as a developer, this is useless. I need to re-create the situation whereby the question is asked for the first time, and cause the UIAlert which says, "Don't Allow / Allow" to re-appear.
Deleting the app and all data, and re-compiling anew from XCode does not work. It seems this permission/denial is stored somewhere that I do not know about [keychain?]. How can I restore everything such that the device thinks this permission has never been granted/denied before, WITHOUT having to go into 'Settings'?
ACAccountStore *accountStore = [[ACAccountStore alloc] init];
ACAccountType *accountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];
[accountStore requestAccessToAccountsWithType:accountType options:nil completion: ^ (BOOL granted, NSError *error) {
if(granted == YES){
// granted code goes here
} else {
// not granted code goes here
}
}];
You can't reset this without going into settings or changing the bundle ID of the app. Since the former is more sensible:
Go to: Settings -> General -> Reset -> Reset Location & Privacy.
This will cause the app to ask for permissions again.