简体   繁体   English

无法使用Facebook New SDK 3.11将链接和图像发布到朋友墙

[英]not able to post link and images to friends wall with facebook new sdk 3.11

I'm using facebook new sdk 3.11 for posting links and images to friends wall through fbwebdialog.I'm getting the following error when giving link parameter.(As in the screen shot below) 我正在使用facebook new sdk 3.11通过fbwebdialog将链接和图像发布到朋友墙。给定链接参数时出现以下错误(如下图所示)

在此处输入图片说明

I'm using Xcode 5 and my code is below 我正在使用Xcode 5,我的代码如下

NSMutableDictionary *params1 = [NSMutableDictionary dictionaryWithObjectsAndKeys: @"TESTING PURPOSE", @"name",@"545268428900714",@"app_id",fid,@"to",@"http://www.google.com",@"link", nil];


[FBWebDialogs presentFeedDialogModallyWithSession:nil parameters:params1 handler:
 ^(FBWebDialogResult result, NSURL *resultURL, NSError *error)
 {
     NSLog(@"result ======%@",resultURL);
     if (error)
     {
         NSLog(@"error ======%@",error);
     }
     else
     {
         if (result == FBWebDialogResultDialogNotCompleted)
         {
             NSLog(@"User canceled story publishing.");
         }
         else
         {
             NSDictionary *urlParams = [self parseURLParams:[resultURL query]];
             if (![urlParams valueForKey:@"post_id"])
             {
                 NSLog(@"User canceled story publishing.");
             }
             else
             {
                 // [FBSession.activeSession close];
                 //[FBSession.activeSession closeAndClearTokenInformation];


                 double delayInSeconds = 0.5;
                 dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));
                 dispatch_after(popTime, dispatch_get_main_queue(), ^(void){


                     UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Thank You!" message:[NSString stringWithFormat:@"Your Post has been Posted to your friends wall!"] delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];

                     [alertView show];


                 });


             }
         }
     }
 }];

This error happens as the selected app would be Graph explorer and its canvas/site url is not pointing to your site. 发生此错误的原因是所选的应用程序将是“图形资源管理器”,并且其画布/网站网址未指向您的网站。

This answer from the WordPress forums via user Samuel Wood (Otto) : 通过用户Samuel Wood(Otto)WordPress论坛获得的答案:

Go to the Facebook App. Edit its settings. On the Advanced settings page, disable the "Stream post URL security" option.

refer this SO question. 请参阅 SO问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM