Sometimes the Facebook share dialog doesn't load on iOS
Asked Answered
K

1

6

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
                                       }
                                   }];
//    }
 }
Karlenekarlens answered 16/7, 2013 at 19:1 Comment(3)
I have seen this many times and I personally think it is a bug with the Facebook app. Often when asking for Facebook permission or attempting to open the share dialog, the facebook app will hang for a long time and then seem to try and recover by just going to the news feed. I am not sure, but it seems like sometimes the Facebook app can't handle a request for the share dialog if it is in a certain state in the background.Annabelannabela
I am having same issue, Is there any solution, Or its just bug in Facebook?Dextrosinistral
Hey Guys Any update on this bug ?Worrisome
M
1

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.

Moisture answered 29/4, 2016 at 7:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.