Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8476507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:11:54+00:00 2026-06-10T18:11:54+00:00

I know that to get access to a configured twitter account using twitter framework

  • 0

I know that to get access to a configured twitter account using twitter framework in iOS 5, the following can be done:

ACAccountStore *t_account = [[ACAccountStore alloc] init];
ACAccountType *accountType = [account accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];
[account requestAccessToAccountsWithType:accountType withCompletionHandler:^(BOOL granted, NSError *error) {
    if (granted == YES) {
    }
}

But the problem is that I don’t have need for a full account, I just want the twitter name if he has configured any on the twitter accounts. So, Is there a way to get just the twitter handle from the framework (not the full account) without asking any user permission ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T18:11:56+00:00Added an answer on June 10, 2026 at 6:11 pm

    You won’t get access to any accounts without the user granting permission to access those accounts. Just try through the following in an app delegate in a new project so you know that app has not been given permissions to access the twitter accounts. Of course make sure you have at least one twitter account on the device or in the simulator and the accounts framework imported in your project and app delegate. Also you are making the assumption that the user has only one twitter account. Best to code for a case where a user may have more than one account.

        ACAccountStore *accountStore = [[ACAccountStore alloc] init];
    
        // Create an account type that ensures Twitter accounts are retrieved.
        ACAccountType *accountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];
    
        NSArray *accountsArray = [accountStore accountsWithAccountType:accountType];
    
        for (ACAccount *account in accountsArray ) {
            NSLog(@"Account name: %@", account.username);
        }
    
        NSLog(@"Accounts array: %d", accountsArray.count);
    

    Now change the code to return your results when a user has granted permission:

        ACAccountStore *accountStore = [[ACAccountStore alloc] init];
    
        // Create an account type that ensures Twitter accounts are retrieved.
        ACAccountType *accountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];
    
        [accountStore requestAccessToAccountsWithType:accountType withCompletionHandler:^(BOOL granted, NSError *error) {
    
        if(granted) {
    
            NSArray *accountsArray = [accountStore accountsWithAccountType:accountType];
    
            for (ACAccount *account in accountsArray ) {
                NSLog(@"Account name: %@", account.username);
            }
    
            NSLog(@"Accounts array: %d", accountsArray.count);
        }
    }];
    

    So I guess the short answer is, there is a reason apple ask the user to grant permission to user accounts. If that access has not been granted you aren’t going to get any data back.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that I can get the true bits with the simple loop, but
I know that I can get word completion through CTRL+N & CTRL+P and code
I know that I can get a POSIX int file handle from NSURL by
I know that in Oracle I can get the generated id (or any other
I know that in J2ME I can get a byte[] object from a String
I want to know where I can get access to the NinePatch images specifically
In code: //I know that to get this effect (being able to use it
I know that the specification exactly defines it but cannot get what is the
I know enough to know that we need to get our application to deploy
I know that 2d arrays are arrays of arrays. To get a row you

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.