ImpurestClub ImpurestClub - 1 month ago 26
iOS Question

iOS: FBSDKShareDialog Opening App but Not Allowing User to Share Link

I'm trying to integrate the new Facebook SDK into an app I'm working on and for some reason whenever I try and share a link the share screen doesn't come up. I get kicked to the Facebook app (or the web app if there's no Facebook app installed), but I never get an option to share the link I'm trying to get the user to post.

I've pretty much followed the example on the Facebook developer site to a T, but for reference, here's my code:

- (IBAction)shareToFacebook:(id)sender {
NSLog(@"Share to Facebook");
FBSDKShareLinkContent *content = [FBSDKShareLinkContent new];
content.contentURL = [NSURL URLWithString:@"http://google.com"];
content.contentTitle = @"Test Post!";
content.contentDescription = @"Content Description;
FBSDKShareDialog *shareDialog = [FBSDKShareDialog new];
[shareDialog setMode:FBSDKShareDialogModeAutomatic];
[shareDialog setShareContent:content];
[shareDialog setFromViewController:self];
[shareDialog show];
// [FBSDKShareDialog showFromViewController:self withContent:content delegate:nil];
}


As you can see above, I've tried using both the convenience method Facebook uses in their documentation, as well as being more verbose, but both produce the same result (opening the Facebook app but not giving the user an option to share any content). Any help at all would be greatly appreciated!

Answer

It actually turned out to be a small typo in my info.plist for the app. Just a heads up to anyone else getting a similar error to check over all the information they have setup there and be sure it's all correct.