How to renew request access to Twitter account again in iOS?

290 views Asked by At

I request access to Twitter account by this code:

-(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");
        }

    }];

}

The problem is that I call this method again when user choose "Don't Allow" but it just work OK 1time.

1st time, it ask for permission, if user choose "Don't Allow", the asking alert view not display again. I just see the log "Not Grand".

How can we renew request access to twitter again so that the alertView for permission display again?

3

There are 3 answers

0
nerowolfe On

I think you only can say (message if there are no access) user to allow app to use twitter again in twitter section in settings app.

0
Muruganandham K On

Go to settings and enable Allow these apps to use your account switch for respective application Manually. Once you tapped Don't allow then the switch become off. Make the user to enable the Switch.

0
Nitin Gohel On

As par My Knowledge this is Not Possible once use can select "Don't Allow" that not asking again. This is a same like Address-book Permission Alert or Location Permission.

So you can set Manually Alert Massage for allow Access From setting and that need Manually open Setting view and Logged in From there.