0

我正在使用以下代码。它带我进入我授权应用程序的 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];


}
4

1 回答 1

0

You should do it like this:

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];
于 2012-09-27T15:24:46.657 回答