I am trying to set up Facebook sharing with FBSDK in my iOS app.
I have been reading the documentation here, and currently have
[FBSDKShareDialog showFromViewController:self withContent:content delegate:self];
working with a content object - FBSDKShareLinkContent
.
However, upon trying to use the similar method as specified for Facebook Messenger sharing,
[FBSDKMessageDialog showWithContent:content delegate:self];
i am getting a crash. I caught the error and logged it in one of the delegate methods, and it states "The operation couldn’t be completed. (com.facebook.sdk.share error 202.) "
I have searched for this specific error but have not found anything directly with the same error. Here is full code
FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
content.contentURL = [NSURL URLWithString:kAPPShareLink];
content.contentDescription = kAPPShareDescription;
content.contentTitle = kAPPShareTitle;
if (buttonIndex == 0) {
// Facebook
[FBSDKShareDialog showFromViewController:self withContent:content delegate:self];
} else if (buttonIndex == 1) {
// Facebook Messenger
[FBSDKMessageDialog showWithContent:content delegate:self];
}
Forgive me if i am missing something obvious, but as this documentation reads, i assume the FBSDKMessageDialog showWithContent:
method would work the same way as FBSDKShareDialog showFromViewController:
which is working for me.
- I am using the latest version of XCode with iOS8.