2012-09-06 5 views

답변

0

당신은 페이스 북의 API에 요청을 게시하고 토큰을 다시 유효한 액세스 할 수 또는 사용자가 로그인 할 Facebook iOS SDK를 사용할 수 있습니다.

-(NSString *)loadAccessToken{ 
    NSString *accessTokenURL = [NSString stringWithFormat:@"https://graph.facebook.com/oauth/access_token?client_id=%@&client_secret=%@&grant_type=client_credentials",client_id, client_secret]; 

    ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:accessTokenURL]]; 
    [request startSynchronous]; 

    NSMutableString *accessMutable = [[request responseString] mutableCopy]; 
    [accessMutable replaceOccurrencesOfString:@"access_token=" 
           withString:@"" 
            options:NSLiteralSearch 
            range:NSMakeRange(0, [[request responseString] length])]; 

    return accessMutable; 
} 
관련 문제