I'm trying to share a post with the Facebook SDK, but sharerDidCancel is always called, either if I share or cancel the post. Here is my code
- (void)shareFacebook {
FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
content.contentURL = [NSURL URLWithString:@"http://www.google.com"];
[FBSDKShareDialog showFromViewController:view
withContent:content
delegate:self];
}
- (void)sharer:(id<FBSDKSharing>)sharer didCompleteWithResults :(NSDictionary*)results {
NSLog(@"FB: SHARE RESULTS=%@\n",[results debugDescription]);
}
- (void)sharer:(id<FBSDKSharing>)sharer didFailWithError:(NSError *)error {
NSLog(@"FB: ERROR=%@\n",[error debugDescription]);
}
- (void)sharerDidCancel:(id<FBSDKSharing>)sharer {
NSLog(@"FB: CANCELED SHARER=%@\n",[sharer debugDescription]);
}
This class implements the FBSDKSharingDelegate, in my Info.plist I already entered the FacebookAppID and FacebookDisplayName.
In my AppDelegate I have this method:
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
return [FBAppCall handleOpenURL:url sourceApplication:sourceApplication];
}
What I'm doing wrong? I exactly followed the Facebook SDK guide.
Thanks