0
我正在使用下面的代碼。它將我帶到FB對話框,在那裏我授權應用程序,授權應用程序後,它將我帶回到我的應用程序。不過它絕不會在牆上發佈任何內容。IOS 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];
}
我看不出有什麼區別,但仍不能工作:d –
你在開玩笑吧?你沒看到我調用'requestWithGraphPath:graphPath andParams:params andHttpMethod:@「POST」andDelegate:self]'method?這是實際在你的牆上發佈帖子的方法 – Stas