gpt4 book ai didi

iphone - Facebook Connect iPhone 自定义发布流

转载 作者:可可西里 更新时间:2023-11-01 05:07:10 25 4
gpt4 key购买 nike

我刚刚下载了适用于 iOS 的 Facebook SDK,因为我需要能够将自定义流发布到用户的 Facebook 订阅源。示例应用程序有一个名为 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:
@"Share on Facebook", @"user_message_prompt",
actionLinksStr, @"action_links",
attachmentStr, @"attachment",
nil];


[_app.facebook dialog:@"feed"
andParams:params
andDelegate:self];`

此代码是否应该填充自定义流?如果是这样,为什么演示项目不为我做这件事?如果没有,我需要采取哪些步骤才能使用自定义数据填充流?

谢谢你的帮助,

最佳答案

示例应用有点过时。阅读 Facebook 的 Feed Dialog documentation查看您可以设置的属性,然后像这样设置:

NSDictionary* params = [NSDictionary dictionaryWithObjectsAndKeys:
@"Share on Facebook", @"user_message_prompt",
@"http://www.yoursitehere.com/", @"link",
@"http://www.yoursitehere.com/thumbnail.jpg", @"picture",
nil];


[self.facebook dialog:@"feed" andParams:params andDelegate:self];

关于iphone - Facebook Connect iPhone 自定义发布流,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5124197/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com