【问题标题】:IOS Fb wall post method not workingIOS Fb墙贴方法不起作用
【发布时间】:2012-09-27 14:54:27
【问题描述】:

我正在使用以下代码。它带我进入我授权应用程序的 FB 对话框,授权应用程序后它带我回到我的应用程序。但是它从不在墙上张贴任何东西。

有什么想法吗?

- (void) login 
{
   AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];

    appDelegate.facebook = [[Facebook alloc] initWithAppId:@"MY_APP_ID" andDelegate:self];


    NSArray* permissions =  [NSArray arrayWithObjects:@"publish_stream", nil];

    [appDelegate.facebook authorize:permissions];


    NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                   @".", @"name",
                                   @".", @"caption",
                                   nil];

    /*
     NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
     @".", @"name",
     @"Build great social apps and get more installs.", @"caption",
     @"The Facebook SDK for iOS makes it easier and faster to develop Facebook integrated iOS apps.", @"description",
     @"https://developers.facebook.com/ios", @"link",
     @"https://raw.github.com/fbsamples/ios-3.x-howtos/master/Images/iossdk_logo.png", @"picture",
     nil];
     */

    // Invoke the dialog
    [appDelegate.facebook dialog:@"feed" andParams:params andDelegate:self];


}

【问题讨论】:

    标签: objective-c cocoa-touch facebook-graph-api ios5


    【解决方案1】:

    你应该这样做:

    graphPath = @"me/feed";
    [params setObject:@"link" forKey:@"type"];
    [params setObject:pict forKey:@"picture"];
    [params setObject:self.url forKey:@"link"];
    [params setObject:self.message forKey:@"message"];
    [params setObject:self.urlName forKey:@"name"];
    [params setObject:self.caption forKey:@"caption"];
    [params setObject:self.urlDescription forKey:@"description"];
    [appDelegate.facebook requestWithGraphPath:graphPath andParams:params andHttpMethod:@"POST" andDelegate:self];
    

    【讨论】:

    • 你在开玩笑吗?你没看到我在调用requestWithGraphPath:graphPath andParams:params andHttpMethod:@"POST" andDelegate:self] 方法吗?这是实际上在你的墙上发帖的方法
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-07-17
    • 1970-01-01
    • 1970-01-01
    • 2011-07-23
    • 1970-01-01
    • 1970-01-01
    • 2011-07-21
    相关资源
    最近更新 更多