Sometimes when I launch the Facebook share dialog, the OS switches to the Facebook app, but the share dialog doesn't load. Then if you try again, it usually works. Why doesn't it work the first time?
NSURL* url = [NSURL URLWithString:@"some URL"];
FBShareDialogParams* params = [[FBShareDialogParams alloc] init];
params.link = url;
if ([FBDialogs canPresentShareDialogWithParams:params]) {
[FBDialogs presentShareDialogWithLink:url
handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
if(error) {
NSLog(@"Error posting to FB: %@", error.description);
//do something
} else {
//do something else
}
}];
// }
}
The Login Dialog allows someone to use Facebook Login to grant permissions to an app. The Add Page Tab Dialog allows someone to add an app to a tab on a Facebook Page which they admin. The Requests Dialog allows someone to send a request to one or more of their friends from a game.
Share Sheet lets you preview your post before it reaches your Facebook feed and offers options to share with particular people.
This class is no longer available in the most recent version of the SDK.
You should use FBSDKShareDialog instead of this.The latest version is v4.11.0.
Thanks.
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