After logging in to Twitter, I can print some useful data, such as username and user ID. However, the OAuth token is always zero. How do i get this? I need to send the OAuth token to my server so that it can verify that the user is really who he is talking to.
ACAccountStore* accountStore = [[ACAccountStore alloc] init]; ACAccountType* twitterType = [self.context.accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter]; [accountStore requestAccessToAccountsWithType:twitterType withCompletionHandler:^(BOOL isAllowed, NSError* error) { dispatch_sync(dispatch_get_main_queue(), ^(void) { if (isAllowed) { ACAccount* account = [[self.context.accountStore accountsWithAccountType:[self.context.accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter]] lastObject]; NSLog(@"username = %@", account.username); NSLog(@"user_id = %@", [[account valueForKey:@"properties"] valueForKey:@"user_id"]);
I think: "I need Reverse Auth , but this tutorial mysteriously left the code for" Step 1 ".
source share