我没有收到我的脸谱资料图片。 我得到我的脸书id = 739615472819667;
+(NSDictionary *)getImage:(NSString *)idd
{
NSLog(@"%@",idd);
NSDictionary *imageDictionary;
if ([self hasInternetConnection] == YES) {
NSString *urlStr=[NSString stringWithFormat:@"https://graph.facebook.com/%@/picture",idd];
NSMutableURLRequest *request=[[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:urlStr]];
imageDictionary = [self sendRequest:request];
NSLog(@"%@",imageDictionary);
return imageDictionary;
}
}
答案 0 :(得分:3)
试试这个
NSString *userImageURL = [NSString stringWithFormat:@"https://graph.facebook.com/%@/picture?type=large", pass your ID];
// pass this String where U need, like convert URL to Image or else
可以使用的其他查询参数是:
我得到了你的ID好友的输出,例如
https://graph.facebook.com/739615472819667/picture?type=large
答案 1 :(得分:0)
它会起作用(用你的FBID替换FbID)。
`NSString * strProfilePicURL = nil;
if([[NSUserDefaults standardUserDefaults] objectForKey:@" FbID"]!= nil)
{
strProfilePicURL = [NSString stringWithFormat:@" https://graph.facebook.com/%@/picture",[[NSUserDefaults standardUserDefaults] objectForKey:@" FbID"]];
}
imgSelf = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL] URLWithString:strProfilePicURL]]];`