使用Facebook Open Graph发布故事时出错

时间:2012-11-19 17:59:03

标签: iphone objective-c ios facebook

我正在尝试发布一个故事,但Open Graph返回给我这个错误:domain = com.facebook.sdk,code = 5

我使用这些权限:

 [NSArray arrayWithObjects: @ "status_update" @ "publish_actions" @ "publish_stream" @ "user_likes" @ "create_event", nil];

我用来创建历史的代码:

NSMutableDictionary * item = [FBGraphObject graphObject];      
[Item setObject: @ "http://mysite.com.br/cardapio/6/burger-de-carne" forKey: @ "object"];

NSMutableDictionary * action = (<FBOpenGraphAction> NSMutableDictionary *) [FBGraphObject graphObject];
 [Action setObject: item forKey: @ "Like"];

  [FBRequestConnection startForPostWithGraphPath: @ "me/og.like" graphObject: action  completionHandler: ^ (* FBRequestConnection connection,   id result,  NSError * error)
 {  NSString * alertText;

                              if(! error) 
                             { alertText = [NSString stringWithFormat: @ "Open Graph Posted action, id:% @", [Result objectForKey: @ "id"]]; 
                              Else { 
                                     alertText = [NSString stringWithFormat: @ "error:% @ domain =, code =% d",  error.domain, error.code];  }

 [[[UIAlertView alloc] initWithTitle: @ "Result"  message: alertText delegate: nil  cancelButtonTitle: @ "Thanks!"  otherButtonTitles: nil]  show];
  }];

0 个答案:

没有答案