I am not getting my facebook profile pic . I am getting my 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;
}
}
try this
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
Other query parameters that can be used are:
I got the output for your ID friend, example
https://graph.facebook.com/739615472819667/picture?type=large
It will work (Replace FbID with your 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]]];`
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.