如何将照片发布到facebook iphone fbconnect [英] How to post photos to facebook iphone fbconnect
问题描述
您好我正在使用FBConnect发布到Facebook,现在我需要从图书馆发布照片或者使用凸轮拍摄,有没有人知道怎么做?我在谷歌搜索过但我找不到适合我的代码。我找到了这个方法:
Hi I'm using FBConnect to post to facebook, now I need to post photos from library or taken with the cam, does anyone has a clue how to do this ?? I've searched in google but I can't find a piece of code that works for me. I've found this method:
FBRequest *uploadPhotoRequest = [FBRequest requestWithDelegate:self];
[uploadPhotoRequest call:@"photos.upload" params:args];
但是在我的fbconnect中我有这个:(我认为api的版本不同)
but in my fbconnect i have this one instead: (I think the version of the api is different)
[_fbRequest call:(NSString *) params:(NSDictionary *) dataParam:(NSData *)];
此外,我正在使用此方法发布到墙上:
Also I'm using this method to post to the wall:
- (void)postToWall { FBStreamDialog* dialog = [[[FBStreamDialog
alloc] init] autorelease];
dialog.userMessagePrompt = @"Enter your message:";
dialog.attachment = [NSString stringWithFormat:@"{\"name\":\"%@ Esta conectado desde TravelFan iPhone App\",\"caption\":\"Viajar te cambia la vida\",\"description\":\"\",\"media\":[{\"type\":\"image\",\"src\":\"http://www.travelfan.com.mx/content/templates/default/images/logo_travel.jpg\",\"href\":\"http://www.travelfan.com.mx/\"}]}",
_facebookName];
dialog.actionLinks = @"[{\"text\":\"Obten TravelFan
App!\",\"href\":\"http://www.travelfan.com.mx/\"}]"; [dialog show];
}
在这种方法中,我可以发送图像但不能作为照片应用程序徽标及其附件。
In this method I can send an image but not as a photo its just for the app logo and its an attachment.
任何人都可以告诉如何将照片发布到墙上吗?
任何帮助都是apreciated XD。
Can anyone tell how to post photos to the wall pls ?? Any help is apreciated XD.
推荐答案
您现在可以用在墙上发布照片requestWithGraphPath
方法如下。
You can now post photos on your wall with requestWithGraphPath
method as follows.
NSData *yourImageData= UIImagePNGRepresentation(yourImage);
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"Your text with picture", @"message", yourImageData, @"source", nil];
[facebook requestWithGraphPath:@"/me/photos" andParams:params andHttpMethod:@"POST" andDelegate:self];
这篇关于如何将照片发布到facebook iphone fbconnect的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!