2013-04-08 5 views
1

Я создал titter login в моем приложении 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]; 
} 

ответ

Смежные вопросы