SSS*_*SSS 4 iphone publish facebook connect ios
我刚刚下载了适用于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];`
Run Code Online (Sandbox Code Playgroud)
这段代码应该填充自定义流吗?如果是这样,为什么演示项目不适合我呢?如果没有,为了使用自定义数据填充流,我需要采取哪些步骤?
谢谢你的帮助,
示例应用程序有点过时了.阅读Facebook的Feed对话文档,查看您可以设置的属性,然后,就像这样做:
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];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4067 次 |
| 最近记录: |