来自IOS的Facebook帖子不起作用

时间:2012-06-30 07:36:21

标签: ios facebook facebook-graph-api facebook-wall

我正试图将我的IOS应用程序发布到facebook feed。以下是我在代码中包含的测试。

Facebook *facebook = [[Facebook alloc] initWithAppId:FB_APPID_REMOTE andDelegate:self];

// Create the parameters dictionary that will keep the data that will be posted.
NSMutableDictionary *fbParams = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                               @"My test app", @"name",
                               @"http://www.google.com", @"link",
                               @"FBTestApp app for iPhone!", @"caption",
                               @"This is a description of my app", @"description",
                               @"Hello!\n\nThis is a test message\nfrom my test iPhone app!", @"message",              
                               nil];
[facebook requestWithGraphPath:@"me/feed" andParams:fbParams andHttpMethod:@"POST" andDelegate:self];

但是,我没有看到帖子更新到我的Facebook Feed。我错过了什么吗?

2 个答案:

答案 0 :(得分:0)

方法requestWithGraphPath返回FBRequest的对象。因此,您可以检查request.state以确定请求的状态,并检查request.error以了解问题究竟是什么。

答案 1 :(得分:0)

使用AppDelegate将返回您从View调用的同一页ViewController。但是,由于您没有收到任何明显的错误日志或崩溃,我认为这是Facebook graph protocol的一些问题。

"me/feed"替换为"feed",因为这对我来说很合适。