使用新的sdk在我的Facebook墙上发布

问题描述:

我正在使用新的Facebook SDK按照他们的指示

I am using the new Facebook SDK to publish on my wall by following their instructions

我从应用程序获得授权,但当我尝试发布时我收到错误
错误:HTTP状态代码:400 下面我发布我的代码

I got authorization from the app, but when i try to publish i am getting an error Error: HTTP status code: 400 below i am posting my code

 - (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是测试版?或者一个完整的?

What am i doing wrong here and any suggestion will be great and this new SDK is a beta version ? or a complete one ?

如果您遇到任何问题,请尝试在请求调用之前添加此代码来启用日志记录'对调试感兴趣:

If you run into any issues, try turning on logging by adding this code before the request call you're interested in debugging:

[FBSettings setLoggingBehavior:[NSSet
setWithObjects:FBLoggingBehaviorFBRequests,
FBLoggingBehaviorFBURLConnections,
nil]];