【问题标题】:Use Feed dialog of Facebook API - Iphone使用 Facebook API 的 Feed 对话框 - Iphone
【发布时间】:2012-03-27 22:27:26
【问题描述】:

我已经在我的应用程序代码中集成了 facebook api,提要对话框的参数有一个奇怪的问题:

这段代码完美运行:

NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                kAppId, @"app_id",
                @"http://developers.facebook.com/docs/reference/dialogs/", @"link",
                @"http://fbrell.com/f8.jpg", @"picture",
                @"Facebook Dialogs", @"name",
                @"Reference Documentation", @"caption",
                @"Using Dialogs to interact with users.", @"description",
                               nil];
[facebook dialog:@"feed" andParams:params andDelegate:self];

但如果删除单个值不起作用:

NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                kAppId, @"app_id",
                @"Facebook Dialogs", @"name",
                @"Using Dialogs to interact with users.", @"description",
                               nil];
[facebook dialog:@"feed" andParams:params andDelegate:self];

我不需要@caption、@link 和@picture。我简单地把描述贴到墙上。

【问题讨论】:

  • 删除参数中的 kAppId 并尝试一次。
  • 感谢您的回复。我试图删除 kAppId 但结果相同。不幸的是,不起作用。

标签: iphone objective-c ios facebook


【解决方案1】:

像这样使用代码,

    NSArray* actionLinks = [NSArray arrayWithObjects:[NSDictionary dictionaryWithObjectsAndKeys:
                                                  @"Glueper App",@"name",@"http://m.facebook.com/apps/hackbookios/",@"link", nil], nil];
NSString *actionLinksStr = [jsonWriter stringWithObject:actionLinks];
// Dialog parameters
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                               @"I'm using the Glueper App", @"name",
                               @"Glueper App", @"caption",
                               objSelGameStep.smsg, @"description",
                               @"http://m.facebook.com/apps/hackbookios/", @"link",
                               actionLinksStr, @"actions",
                               nil];

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

这允许您在 FB 墙上发帖....

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-10-29
    • 1970-01-01
    • 1970-01-01
    • 2011-10-10
    • 2012-10-08
    相关资源
    最近更新 更多