如何从fbprofilepictureview检索图像并将此图像存储到数据库中

时间:2013-12-23 10:01:24

标签: ios objective-c facebook ipad

显示个人资料照片。

      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);

1 个答案:

答案 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];

}
相关问题