ios Facebook Connect iPhone自定义发布流

bpzcxfmw  于 2023-05-30  发布在  iOS
关注(0)|答案(2)|浏览(167)

我刚刚下载了Facebook的iOS SDK,因为我需要能够发布自定义流到用户的Facebook提要。示例应用程序有一个名为publishStream:(id)sender的方法,它似乎为PublishStream对话框设置了一个自定义描述,但当我的对话框出现时,我看到的只是一个空对话框,可以开始输入。示例应用程序中的代码如下:
`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];`

此代码是否应该填充自定义流?如果是这样的话,为什么演示项目不为我做这些呢?如果没有,我需要采取什么步骤才能用自定义数据填充流?
谢谢你的帮助

7lrncoxx

7lrncoxx1#

示例应用程序有点过时。阅读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];
mrfwxfqh

mrfwxfqh2#

@Mahmud:Facebook会自动生成你朋友的订阅源,以显示你的主页订阅源部分;一旦你在墙上发帖,你的朋友的主屏幕将按照Facebook用于填充一个人的主页提要的算法来获取你的帖子;可能是你的饲料没有得到最高位置在家庭饲料项目,但它肯定会有...后4 5个职位;

相关问题