2011-06-24 160 views
3

我陷入了奇怪的境地。我想从iPad应用程序上传照片,该照片始终显示在用户的墙上。我已经尝试使用“facebook.photo.upload”方法,但由于某种原因,它会在用户的墙上显示1张照片,并且所有其他上传都会直接进入相册,而不会出现在用户的墙上。所以我想在用户的墙上展示所有照片。在Facebook墙上上传照片iPhone sdk

所以,另一种情况是我可以使用“stream.publish”,并附上我的照片附件参数。但在这种方法中,我需要我的UIImage的URL,这是我没有的。即使我管理网址仍然我猜我的照片会显示为所有其他流显示的缩略图。我想要我的照片保存大小768X1004。

那么,在iPhone SDK中实现这一点的最佳方法是什么?我只想每次都在用户的墙上上传我的照片。我不介意它是否在专辑中。

在此先感谢帮助..

编辑:

我上传的照片,以我自己的服务器完成这一点,并使用publish.stream张贴到用户的墙。我没有得到任何其他的方式。

+0

你使用过图api – iProgrammer

回答

0

没有得到任何解决方案。所以我通过将照片上传到我自己的服务器并使用publish.stream将其发布到用户的墙上来实现此目的。我没有得到任何其他的方式。

+0

你好,请问你告诉我如何做到这一点,你可以分享一些编码。 – Vijay

+0

嗨Vijay,我上传使用API​​和API的服务器上的实际图像返回给我的照片的网址,我用“stream.publish”中的网址。这样我就解决了我的问题。 – Deeps

1

尝试Facebook的图形API的这种方法,将张贴在Facebook上墙的照片

-(IBAction)postPictureButtonPressed:(id)sender { 

    NSMutableDictionary *variables = [NSMutableDictionary dictionaryWithCapacity:2]; 

    //create a UIImage (you could use the picture album or camera too) 

    NSData *imageData = UIImageJPEGRepresentation(imageView.image, 8.0); 
    UIImage *picture = [UIImage imageWithData:imageData]; 

    //create a FbGraphFile object insance and set the picture we wish to publish on it 
    FbGraphFile *graph_file = [[FbGraphFile alloc] initWithImage:picture]; 

    //finally, set the FbGraphFileobject onto our variables dictionary.... 
    [variables setObject:graph_file forKey:@"file"]; 

    [variables setObject:@"this is a test message: postPictureButtonPressed" forKey:@"message"]; 

    //the fbGraph object is smart enough to recognize the binary image data inside the FbGraphFile 
    //object and treat that is such..... 
    FbGraphResponse *fb_graph_response = [fbGraph doGraphPost:@"117795728310/photos" withPostVars:variables]; 
    NSLog(@"postPictureButtonPressed: %@", fb_graph_response.htmlResponse); 

    NSLog(@"Now log into Facebook and look at your profile & photo albums..."); 

} 
+0

谢谢@IphoneDeveloper。我现在就试一试。会告诉你这件事的进展的。 – Deeps

+0

我只是给它一个尝试和同样的问题。它直接将照片上传到相册。如果我删除了相册并上传新照片,它会在墙上显示我。之后它不显示。我需要每次为iPad应用上传的每张照片分开墙贴。这是通过图形API的可能吗?谢谢 – Deeps

+0

好吧,我还没有在Facebook上创建任何专辑。可能是那个y我总是转到墙贴吧 – iProgrammer

相关问题