【问题标题】:How to renew request access to Twitter account again in iOS?如何在 iOS 中再次更新对 Twitter 帐户的请求访问权限?
【发布时间】: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


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

      转到设置并启用允许这些应用程序使用您的帐户手动切换各个应用程序。一旦你点击了不允许,开关就会关闭。让用户启用 Switch。

      【讨论】:

        【解决方案3】:

        根据我的知识,这是不可能的,一旦使用可以选择 “不允许” 不再询问。这与Address-book Permission Alert 或Location Permission 相同。

        因此,您可以设置手动警报按摩以允许从设置访问,并且需要手动打开设置视图并从那里登录。

        【讨论】:

          猜你喜欢
          • 2012-10-06
          • 1970-01-01
          • 2015-01-11
          • 2012-06-27
          • 2013-05-04
          • 2014-07-22
          • 1970-01-01
          • 1970-01-01
          • 2014-01-18
          相关资源
          最近更新 更多