我刚刚下载了 iOS 版 Facebook SDK,因为我需要能够将自定义流发布到用户的 Facebook feed。示例应用程序有一个名为publishStream:(id)sender的方法,该方法似乎为“发布流”对话框设置自定义描述,但是当我的对话框出现时,我看到的只是一个可以开始输入的空对话框。示例中的代码应用程序是这样的:
`SBJSON *jsonWriter = [[SBJSON 新] 自动释放];
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:
@"Share on Facebook", @"user_message_prompt",
actionLinksStr, @"action_links",
attachmentStr, @"attachment",
nil];
[_app.facebook dialog:@"feed"
andParams:params
andDelegate:self];`
这段代码应该填充自定义流吗?如果是这样,为什么演示项目不为我做到这一点?如果没有,我需要采取哪些步骤才能使用自定义数据填充流?
感谢您的帮助,