在Facebook上传图片

时间:2011-12-27 08:19:10

标签: iphone ios

在Facebook墙上上传图片时,图片根本没有出现在墙上。 我试过了:

[[FBRequest requestWithDelegate:self] call:@"facebook.Users.setStatus" params:
            params dataParam:UIImagePNGRepresentation(img)];

无济于事。

2 个答案:

答案 0 :(得分:1)

你可以使用Sharekit ....

试试这段代码......

 -(void)shareOnFacebook {   
        //take screenshot
           UIImage *image = "Your image";

       //for debug purpose the image can be stored to photo album
       //UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil);

         SHKItem *fbItem = [SHKItem image:image title:@"Check out my Image!"];
        [SHKFacebook shareItem:fbItem];
    }

答案 1 :(得分:0)

图片会在相册中显示相册以及相关信息。

NSMutableDictionary *params =[NSMutableDictionary dictionaryWithObjectsAndKeys:@"Testmessage", @"message", imageData, @"picture", nil];

[facebook requestWithGraphPath:@"/me/photos" andParams:params andHttpMethod:@"POST" andDelegate:self];