Goutham
Goutham

Reputation: 297

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)

enter image description here

I'm using Xcode 5 and my code is below

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];


                 });


             }
         }
     }
 }];

Upvotes: 0

Views: 182

Answers (1)

Toseef Khilji
Toseef Khilji

Reputation: 17409

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) :

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

refer this SO question.

Upvotes: 1

Related Questions