shim
shim

Reputation: 10116

Sometimes the Facebook share dialog doesn't load on iOS

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

Upvotes: 6

Views: 606

Answers (1)

Banker Mittal
Banker Mittal

Reputation: 1918

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.

Upvotes: 1

Related Questions