无法使用FBDialogs发布到Facebook

时间:2013-10-16 07:52:00

标签: objective-c facebook-graph-api ios7

我在Facebook上使用Facebook SDK Framework发布消息。

我使用原生的facebook对话框发布帖子。

NSString *msg = @"Sample message for posting...";
BOOL displayedNativeDialog = [FBDialogs presentOSIntegratedShareDialogModallyFrom:self initialText:msg images:nil urls:nil handler:^(FBOSIntegratedShareDialogResult result, NSError *error)
                              {
                                  if (!error)
                                  {
                                      NSLog(@"result=%u",result);

                                      if (result == 0) {

                                          UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Successfully posted" message:@"" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
                                          [alert show];

                                      }
                                      else if (result == 1) {

                                          NSLog(@"Cancel");

                                      }
                                      else {

                                          NSLog(@"Dialog not supported");

                                      }

                                  }
                                  else
                                  {
                                      NSLog(@"Dialog not supported. error");
                                  }

                              }];

当我使用此代码时,它成功打开对话框,当我点击本机对话框中的“发布”按钮时,返回结果为0。

但它没有在Facebook上发布并在警告中显示消息“无法发布到Facebook由于iOS7中与Facebook的连接失败,因此无法发送帖子。”

那么,如何解决这个问题呢?为什么这条消息会来? enter image description here

0 个答案:

没有答案