分享Facebook页面链接Facebook iOS SDK

时间:2014-06-05 11:49:30

标签: ios facebook facebook-graph-api

我试图在Facebook上发布我的iPhone应用程序的Facebook页面链接,但它给了我错误

  

发布故事时出错:无法完成操作。   (com.facebook.Facebook.platform错误102。)

我正在使用以下代码:

- (void)showShareFbDialog
{
    // Check if the Facebook app is installed and we can present the share dialog
    FBLinkShareParams *params = [[FBLinkShareParams alloc] init];
    params.link = [NSURL URLWithString:@"https://www.facebook.com/hellothemes"];
    params.name =  @"Title";
    params.caption = @"Caption";
    params.picture = [NSURL URLWithString:imageName];
    params.linkDescription = @"Description";

    // If the Facebook app is installed and we can present the share dialog
    if ([FBDialogs canPresentShareDialogWithParams:params]) {
        // Present the share dialog

        [FBDialogs presentShareDialogWithLink:params.link
                                         name:params.name
                                      caption:params.caption
                                  description:params.linkDescription
                                      picture:params.picture
                                  clientState:nil
                                      handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
                                          if(error) {
                                              // An error occurred, we need to handle the error
                                              // See: https://developers.facebook.com/docs/ios/errors
                                              //NSLog([NSString stringWithFormat:@"Error publishing story: %@", error.description]);
                                              NSLog(@"Error publishing story :%@", error.localizedDescription);
                                          } else {
                                              // actions to perform
                                          }
                                      }];

    } else {
        // Present the feed dialog

        [self shareLinkWithAPICalls];

    }
}

我正在使用最新的Facebook SDK。请帮助我解决问题。

0 个答案:

没有答案