I have to follow below requirement to do Facebook share:
- If user is logged in Facebook app, just ask them to do share with dialog popup.
- If user is not logged-in to Facebook app, ask them to do login first and then show the share dialogue.
I'm using below code to show share dialogue.
FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
content.contentURL = [NSURL URLWithString:permalink];
content.contentDescription = [NSString stringWithFormat:@"%@",smallDescription];
content.imageURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@",guid]];
[FBSDKShareDialog showFromViewController:self
withContent:content
delegate:nil];
Above code works when user is logged in but if not logged in it's shows alert message "You need to be logged into the Facebook app to share this link".