Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FBSDKShareDialog cancels when it should post

I create a FBSDKShareDialog in code

- (void)shareWithFacebookDialog;
{  
  FBSDKShareLinkContent* content = [[FBSDKShareLinkContent alloc] init];
  content.contentURL = [NSURL URLWithString:@"Path Redacted"];
  content.contentTitle = @"Title Redacted";
  content.contentDescription = @"Description Redacted";

  FBSDKShareDialog* dialog = [[FBSDKShareDialog alloc] init];
  [dialog setMode:FBSDKShareDialogModeNative];
  [dialog setShareContent:content];
  [dialog setDelegate:self];
  [dialog setFromViewController:self];
  [dialog show];
}

The dialog launches and all the information is correct

enter image description here

But as soon as Post is tapped the dialog closes and the cancel delegate is called.

- (void)sharerDidCancel:(id<FBSDKSharing>)sharer;

Has anyone seen this? Found a way to overcome it?

like image 385
Damo Avatar asked Jun 26 '15 14:06

Damo


1 Answers

replace your code with this

- (void)shareWithFacebookDialog;
{  
    FBSDKShareLinkContent content = [[FBSDKShareLinkContent alloc]init];
    content.contentURL = [NSURL URLWithString:@"https://www.google.com"];
    content.contentTitle = @"ContentTitle";
    content.contentDescription = @"ContentDescription";
    [FBSDKShareDialog showFromViewController:self
                                 withContent:content
                                    delegate:self];
}

tell me if it works.

like image 164
mars Avatar answered Oct 13 '22 16:10

mars