【发布时间】:2011-09-06 12:51:41
【问题描述】:
我正在尝试从我的朋友列表中向其中一位朋友发布一些数据。 我可以在我朋友的墙上发布一些文字。但它无法发布图像和其他数据。 (目前我只能看到关键“消息”的文本,其余部分没有出现在帖子中。
SBJSON *jsonWriter = [[SBJSON new] autorelease];
/*
Action LInks
*/
NSDictionary* actionLinks = [NSArray arrayWithObjects:[NSDictionary dictionaryWithObjectsAndKeys:
@"Always Running",@"text",@"http://itsti.me/",@"href", nil], nil];
//Json Object Conversion
NSString *actionLinksStr = [jsonWriter stringWithObject:actionLinks];
/*
Media Data in this case an image.
*/
**NSMutableDictionary *dictMedia=[NSMutableDictionary dictionaryWithObjectsAndKeys:@"image",@"type",@"http://www.facebook.com/images/devsite/iphone_connect_btn.jpg",@"src",@"www.fizzysoftware.com",@"href", nil];
NSArray *mediaArray=[[NSArray alloc] initWithObjects:dictMedia, nil];
NSString *mediaJsonString=[jsonWriter stringWithObject:mediaArray]; // error:actionLinksStr]
//Attatchment Data :Include media data,action link etc.
NSDictionary* attachment = [NSDictionary dictionaryWithObjectsAndKeys:
@"First Title", @"name",
@"This is the subtitle", @"caption",
@"This is is description", @"description",
mediaJsonString, @"media", nil];
//Json conversion of the attachment data.
NSString *attachmentStr = [jsonWriter stringWithObject:attachment];**
//Main parameter
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"Share on Facebook", @"message",
actionLinksStr, @"action_links",
attachmentStr, @"attachment",
nil];
//Post to friend's wall, whose uid is friend_uid
[ _facebook requestWithGraphPath:[NSString stringWithFormat:@"friend_uid/feed/"] andParams:params
andHttpMethod:@"POST" andDelegate:self];
我在发送附件时出错的任何建议。我只能在我的帖子中看到 param 的“消息”部分,并且帖子中没有显示任何附件数据。 提前致谢。
【问题讨论】:
标签: iphone ios facebook ios4 facebook-graph-api