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];
您將獲得性反應在follwing方法
-(void)request:(FBRequest *)request didLoad:(id)result
對於示例
{
"first_name" =User;
"last_name" = R;
name = "User R";
"pic_square" = "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-ash2/.jpg";
uid = 595sd1;
}
{},{} etc
希望這會有所幫助!
另一種方式是
獲取ID(或暱稱)的用戶,並從https://graph.facebook.com/idOrNick/picture
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://graph.facebook.com/%@/picture", id]];
NSData *data = [NSData dataWithContentsOfURL:url];
UIImage *image = [UIImage imageWithData:data];
UIImageView *imgView = [[UIImageView alloc]init];
imgView.image = image;
而對於大小
圖像尺寸得到的圖片: 廣場(50 ×50)
小(50像素寬,可變高度)
大(約200個像素寬,可變高度)
和用於施加這種類型的大小的,你必須URL的
例如
http://graph.facebook.com/「ID或尼克」結束其追加/圖象β型=大。 [小/方形/大]
的Femina:我使用FBGraphAPI,什麼是變量_facebook – iYahoo
我需要知道如何設置它的寬度和高度 – iYahoo
_facebook是Facebook類的對象。 – Wolverine