ios - 如何在 iOS 中再次更新对 Twitter 帐户的请求访问权限?

标签 ios twitter acaccountstore

我通过以下代码请求访问 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 次。

第一次,它请求许可,如果用户选择“不允许”,请求警报 View 不再显示。我只看到日志“Not Grand”。

我们如何再次更新对 twitter 的请求访问权限,以便再次显示用于权限的 alertView?

最佳答案

我认为您只能在设置应用程序的推特部分中说(如果无法访问,则发送消息)用户允许应用程序再次使用推特。

关于ios - 如何在 iOS 中再次更新对 Twitter 帐户的请求访问权限?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20798251/

相关文章:

ios - 为 ios react-native itc deploy 加载 ios/main.bundle js 时遇到问题

XCode 中的 iPhone jQuery mobile + PhoneGap .. 具有用于多个 View /页面的多个 html 文件

ios - 在 iOS 中使用 SLRequest 的 Facebook session

ios - 从 URLSession 返回数据并保存在属性变量中

ios - 通过代码而不是 XCode 创建映射模型

javascript - Twitter登录弹出窗口被阻止

twitter - 如何使用 Oauth 将 Base64 图像发布到 Twitter

javascript - 使用 javascript 在客户端格式化推文?

ios - 使用未声明的标识符 "ACAccountStore"

ios - 访问用户twitter账号IOS