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
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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With