2011-08-25 196 views

回答

1

寫FQL獲得的Facebook好友列表&他們的照片管理

NSString *query = @"SELECT uid,name,first_name,last_name,pic_square FROM user WHERE uid IN ("; 
query = [query stringByAppendingFormat:@"SELECT uid2 FROM friend WHERE uid1 = %@)",userid]; 
NSMutableDictionary * params = [NSMutableDictionary dictionaryWithObjectsAndKeys: 
           query, @"query", 
           nil]; 
[_facebook requestWithMethodName: @"fql.query" 
         andParams: params 
        andHttpMethod: @"POST" 
        andDelegate:self]; 

你會得到一個數組ü[R

-(void)request:(FBRequest *)request didLoad:(id)result 

樣品 { 「FIRST_NAME」=用戶; 「last_name」= R; name =「User R」; 「pic_square」=「https://fbcdn-profile-a.akamaihd.net/hprofile-ak-ash2/.jpg」; uid = 595sd1; } {},{}等

希望這有助於!

+0

感謝您的幫助,但如何做到這一點與Facebook圖形API。 Facebook圖形API沒有FBrequest類,所以如何以及在哪裏調用這個FQL? – Anju

+0

@Anju:你使用的是舊的SDK,我想,你這個新的:https://github.com/facebook/facebook-ios-sdk – Karthikeyan

+0

謝謝!!!!!!!其工作.. – Anju

相關問題