【发布时间】:2011-01-05 23:10:27
【问题描述】:
这可能是一个 n00b 问题,但尽管如此...我在 iPad 应用程序中使用 Facebook SDK 时遇到了一点问题:当我使用 [facebook dialog:@"feed" andDelegate:self]; 显示对话框时,我看不到任何可以更改的方法我要分享的内容的标题、内容或 URL。
在他们的 Demo App 中,Facebook 有以下代码:
- (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:
@"Share on Facebook", @"user_message_prompt",
actionLinksStr, @"action_links",
attachmentStr, @"attachment",
nil];
[_facebook dialog:@"feed"
andParams:params
andDelegate:self];
}
但是,当我按下 publishStream 按钮时,对话框中没有显示这些字符串! :S
是不是我做的不对?我在那个 Demo App 中改变的只是 Facebook kAppId 和 URL Scheme。
【问题讨论】: