![](/img/trans.png)
[英]Getting Facebook profile picture URL from graph API for Ionic Hybrid Application
[英]Profile Pic not Getting From Facebook graph api
我没有得到我的Facebook个人资料照片。 我正在获取我的Facebook 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;
}
}
尝试这个
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
它将起作用(用您的FBID替换FbID)。
NSString * strProfilePicURL = nil;
如果([[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]]]];
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.