我的iPhone应用程序在墙上发布Facebook发布时遇到问题。我安装了SDK和链接框架 登录工作正常。这里是代码:在iPhone应用程序墙上的Facebook sdk发布
-(IBAction)loginButtonPressed:(id)sender
{
NSLog(@"loginButtonPressed: called");
AppDelegate *appdel=[[UIApplication sharedApplication] delegate];
appdel.facebookSession=[[FBSession alloc] init];
[appdel.facebookSession openWithCompletionHandler:^(FBSession *session,
FBSessionState status,
NSError *error)
{
//
}];
}
但我有在用户的墙上发布消息的问题。这里的代码:
-(IBAction)likeButtonPressed:(id)sender
{
NSLog(@"likeButtonPressed: called");
// Post a status update to the user's feedm via the Graph API, and display an alert view
// with the results or an error.
NSString *message = @"test message";
NSDictionary *params = [NSDictionary dictionaryWithObject:message forKey:@"message"];
// use the "startWith" helper static on FBRequest to both create and start a request, with
// a specified completion handler.
[FBRequest startWithGraphPath:@"me/feed"
parameters:params
HTTPMethod:@"POST"
completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
[self showAlert:message result:result error:error];
}];
}
请帮助我。我的代码有什么问题?或者我应该添加一些权限登录请求?
你忘了描述实际_problem /错误_。 – CBroe 2012-07-18 11:36:04
当你启动你的Facebook发布时,是否显示登录表单? – 2012-07-18 11:36:05
我在调试中收到一条消息:'错误:HTTP状态码:400'和'操作无法完成。 (com.facebook.FBIOSSDK错误5.)'in'IAlertView' – user1385666 2012-07-18 11:36:14