尝试发布到用户的 Facebook 墙上时出现以下错误,我似乎无法找到来源。有人对这个问题有一些见解吗?
2012-08-29 22:14:38.490 CanP[405:707] Error: HTTP status code: 400
2012-08-29 22:14:38.494 CanP[405:707] FBSDKLog: Response <#1111> <Error>:
The operation couldn’t be completed. (com.facebook.sdk error 5.)
应该将消息发布到 facebook 墙上的运行方法如下:
[FBSettings setLoggingBehavior:[NSSet setWithObjects:
FBLoggingBehaviorFBRequests,
nil]];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:[facebook accessToken] forKey:@"FBAccessTokenKey"];
[defaults setObject:[facebook expirationDate] forKey:@"FBExpirationDateKey"];
[defaults synchronize];
NSMutableDictionary *params = [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];
// Publish.
// This is the most important method that you call. It does the actual job, the message posting.
[facebook requestWithGraphPath:@"me/feed" andParams:params andHttpMethod:@"POST" andDelegate:self];