2013-04-08 34 views
1

我已经在我的iPhone应用程序中创建嘻嘻地笑登录,在这里我想给我的访问令牌和密钥服务器自动共享功能,我不能让我的访问令牌和sekret钥匙,请帮我在此先感谢。我如何从Twitter获取访问令牌?

这是我的代码:

ACAccountType *twitterType = [store accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter]; 
[store requestAccessToAccountsWithType:twitterType 
       withCompletionHandler:^(BOOL granted, NSError *error){ 

        if(!granted){ 
         NSLog(@"%@",[error localizedDescription]); 
        } 
        NSLog(@"store %@",store); 
       }]; 
if([[store accounts] count] > 0) 
{ 
    NSLog(@"TWEET"); 
    self.hasTwitterAccountAccess = YES; 
} 
else 
{ 
    NSLog(@"newlog"); 
    self.hasTwitterAccountAccess = NO; 
} 


if(self.hasTwitterAccountAccess){ 
    NSLog(@"login"); 
    // If we have twitter access, refresh the table view 
    ACAccountType *twitterType = [store accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter]; 
} 

回答