显示个人资料照片。
self.userProfileImage.profileID = user.id;
但
for (NSObject *obj in [userProfileImage subviews]) {
if ([obj isMemberOfClass:[UIImageView class]]) {
UIImageView *objImg = (UIImageView *)obj;
img_ProfilePictureImg.image = objImg.image;
break;
}
}
img_ProfilePictureImg.image=[UIImage imageWithContentsOfFile:profileImage];
我没有得到--- fbprofilepicture
UIImage *img_Profile = --------.imageView.image; // How to get that image view
NSData *dataOfProfilePic = UIImagePNGRepresentation(img_Profile);
答案 0 :(得分:0)
https://graph.facebook.com/username/picture?redirect=true
使用此网址即可获得个人资料照片。
在Facebook代表loginViewFetchedUserInfo
中,您可以获取用户个人资料图片的图片网址
- (void)loginViewFetchedUserInfo:(FBLoginView *)loginView
user:(id<FBGraphUser>)user
{
NSString *imageUrl=[NSString stringWithFormat:@"https://graph.facebook.com/%@/picture?redirect=true", user.username];
}