我通过以下代码请求访问 Twitter 帐户:
-(void)requestAccessToTwitterAccounts{
ACAccountStore *accountStore = [[ACAccountStore alloc] init];
ACAccountType *accountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];
[accountStore requestAccessToAccountsWithType:accountType options:nil completion:^(BOOL granted, NSError *error) {
if (granted)
{
NSLog(@"Granted");
_twAccounts = [accountStore accountsWithAccountType:accountType];
if (_twAccounts.count > 0){
NSLog(@"%@",_twAccounts);
} else {
NSLog(@"No Accoutn");
}
} else{
NSLog(@"Not Grand");
}
}];
}
问题是当用户选择“不允许”时我再次调用此方法,但它只能正常工作 1 次。
第一次,它请求许可,如果用户选择“不允许”,请求警报视图不再显示。我只看到日志“Not Grand”。
我们如何才能再次更新对 twitter 的请求访问权限,以便再次显示用于权限的 alertView?