开发者

Retrive a friend's profile image after loging in

I'm looking for idea on how to use the Facebook connection. I am able to used the Facebook connect on button click, to access the Facebook. The method I wrote:

-(void)login
{
    NSMutableDictionary *params=[NSMutableDictionary dictionary];
    [params setValue:apiString forKey:@"client_id"];
    [_facebook setSessionDelegate:self];
    [_facebook dialog:@"oauth" andParams:params andDelegate:self];

}
-(void)fbDidLogin
{enter code here
    NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys: @"4", @"uids", @"name", @"fields", nil];
    [_facebook requestWithMethodName: @"users.getInfo" andParams: params andHttpMethod: @"GET" andDelegate: self];
    [_facebook requestWithGraphPath:@"me/friends" andDelegate:self];
}

- (void)request:(FBRequest *)request didReceiveResponse:(NSURLResponse *)response {
    NSLog(@"received response");
    }

- (void)request:(FBRequest *开发者_如何学C)request didLoad:(id)result// This method i am using to access all friends name and id after loging.
 {
    if ([result isKindOfClass:[NSArray class]]) {

            result = [result objectAtIndex:0];
          }
NSLog(@"%@" ,result);
}

Now my requirement is that with a friend's name I need to access their profile imag. How can I get a friend's profile image?

I am using the JSON to access Facebook connect.


"/userid/picture" see also https://developers.facebook.com/docs/reference/api/user/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜