我正在使用以下代码。它带我到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];
}
答案 0 :(得分:0)
你应该这样做:
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];