Sometimes the Facebook sharing dialog doesn't load on iOS

Sometimes, when I launch the Facebook sharing dialog, the OS switches to the Facebook application, but the access dialogue does not load. Then, if you try again, it usually works. Why is he not working for 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 } }]; // } } 
+6
source share
1 answer

This class is no longer available in the latest version of the SDK.

Instead, you should use FBSDKShareDialog. The latest version is v4.11.0.

Thanks.

+1
source

Source: https://habr.com/ru/post/949586/


All Articles