iOS Facebook Graph API Profile picture link

后端 未结 3 1325
我在风中等你
我在风中等你 2020-12-03 22:10

I am trying to retrieve the link to the profile picture... So far the graph API call :

[facebook requestWithGraphPath:@\"me/picture\" andDelegate:self];
         


        
3条回答
  •  借酒劲吻你
    2020-12-03 22:24

    make the graph request:

    NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"picture",@"fields",nil];
    [facebook requestWithGraphPath:@"me" andParams:params andDelegate:self];
    

    then on request didLoad:

    NSString *pictureUrl = [result objectForKey:@"picture"];
    

    If you want additional fields, just add them to the params dictionary:

    NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"id,name,picture",@"fields",nil];
    

提交回复
热议问题