【发布时间】:2013-12-27 09:37:44
【问题描述】:
我通过此代码请求访问 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 for permission?
【问题讨论】:
标签: ios twitter acaccountstore