1

我正在尝试将我的 IOS 应用程序中的某些内容发布到 Facebook 提要。以下是我在代码中包含的测试。

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 提要。我在这里错过了什么吗?

4

2 回答 2

0

使用AppDelegate将导致返回到View您从ViewController. 但是由于您没有收到任何明显的错误日志或崩溃,我认为这是Facebook graph protocol.

替换"me/feed""feed"对我来说很好。

于 2013-04-02T15:28:43.760 回答
0

该方法requestWithGraphPath返回一个对象FBRequest。因此,您可以检查request.state以确定请求的状态,并检查request.error到底是什么问题。

于 2012-06-30T07:54:44.680 回答