关于图片下方的文本,您可以查看iOS库提供的演示。例如,上传文本的部分可以在
this file
- (IBAction) publishStream: (id)sender {
SBJSON *jsonWriter = [[SBJSON new] autorelease];
NSDictionary* actionLinks = [NSArray arrayWithObjects:[NSDictionary dictionaryWithObjectsAndKeys:
@"Always Running",@"text",@"http://itsti.me/",@"href", nil], nil];
NSString *actionLinksStr = [jsonWriter stringWithObject:actionLinks];
NSDictionary* attachment = [NSDictionary dictionaryWithObjectsAndKeys:
@"a long run", @"name",
@"The Facebook Running app", @"caption",
@"it is fun", @"description",
@"http://itsti.me/", @"href", nil];
NSString *attachmentStr = [jsonWriter stringWithObject:attachment];
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
kAppId, @"api_key",
@"Share on Facebook", @"user_message_prompt",
actionLinksStr, @"action_links",
attachmentStr, @"attachment",
nil];
[_facebook dialog: @"stream.publish"
andParams: params
andDelegate:self];
}
如果你想在这篇文章中添加一个图片,试试看
NSDictionary* media = [NSDictionary dictionaryWithObjectsAndKeys:
@"image", @"type",
@"your.image/url.png", @"src",
@"http://www.alink.org", @"href",
nil];
NSDictionary* attachment = [NSDictionary dictionaryWithObjectsAndKeys:
@"a long run", @"name",
@"The Facebook Running app", @"caption",
@"it is fun", @"description",
[NSArray arrayWithObjects:media, nil ], @"media",
@"http://itsti.me/", @"href", nil];
您可以在以下位置查看有关流附件的一些指南:
this link
.