我正在按照他们的说明使用新的 Facebook SDK 在我的墙上发布
我从应用程序获得了授权,但是当我尝试发布时,我在
Error: HTTP status code: 400
下面收到错误,我正在发布我的代码
- (void)viewDidLoad
{
self.postParams =
[[NSMutableDictionary alloc] initWithObjectsAndKeys:
@"https://developers.facebook.com/ios", @"link",
@"https://developers.facebook.com/attachment/iossdk_logo.png", @"picture",
@"Facebook SDK for iOS", @"name",
@"build apps.", @"caption",
@"testing for my app.", @"description",
nil];
[self.postParams setObject:@"hgshsghhgsls" forKey:@"message"];
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
-(IBAction)Post{
AppDelegate *appDelegate = [UIApplication sharedApplication].delegate;
[appDelegate openSessionWithAllowLoginUI:YES];
[FBRequestConnection startWithGraphPath:@"me/Mac" parameters:self.postParams HTTPMethod:@"POST"
completionHandler:^(FBRequestConnection *connection,id result,NSError *error) {
NSString *alertText;
if (error) {
alertText = [NSString stringWithFormat:@"error: domain = %@, code = %d, des = %d",error.domain, error.code,error.description];
}
else
{
alertText = [NSString stringWithFormat:@"Posted action, id: %@",[result objectForKey:@"id"]];
}
// Show the result in an alert
[[[UIAlertView alloc] initWithTitle:@"Result" message:alertText delegate:self cancelButtonTitle:@"OK!"
otherButtonTitles:nil]show];
}];
}
我在这里做错了什么,任何建议都会很好,这个新的 SDK 是 beta 版本?还是完整的?