Using the FBSDK mentioned in the title of this question, I present a simple share dialog in a view controller:
// Setup the content for the share
FBSDKShareLinkC
Of course after posting I stumbled upon the answer. The results dictionary returned in the didCompleteWithResults method contains a postId key if the share actually occurred. So the logic is as simple as:
- (void)sharer:(id<FBSDKSharing>)sharer didCompleteWithResults:(NSDictionary *)results
{
NSURL *fbURL = [NSURL URLWithString:@"fb://"];
if (![[UIApplication sharedApplication] canOpenURL:fbURL])
if (results[@"postId"]) {
NSLog(@"Sweet, they shared, and Facebook isn't installed.");
} else {
NSLog(@"The post didn't complete, they probably switched back to the app");
}
} else {
NSLog(@"Sweet, they shared, and Facebook is installed.");
}
}
Although this works, it doesn't seem to be a very safe way of going about things (what if Facebook changes the key from "postId" to something else in the future? Unlikely but you get my point).