I'm implementing the share dialog using the Facebook SDK for iOS. Everything works fine except for the callback. This is the function that displays the dialog:
FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
content.contentURL = <my content url>;
content.contentTitle = <my title>;
content.contentDescription = my description;
content.imageURL = <my image url>;
[FBSDKShareDialog showFromViewController:self
withContent:content
delegate:self];
The view controller implements the FBSDKSharingDelegate and the three required methods:
- (void)sharer:(id<FBSDKSharing>)sharer didCompleteWithResults:(NSDictionary *)results;
- (void)sharer:(id<FBSDKSharing>)sharer didFailWithError:(NSError *)error;
- (void)sharerDidCancel:(id<FBSDKSharing>)sharer;
Basically I have to detect if users pressed the cancel button because I give them a reward only if they effectively share the content. The problem is that even if I press the cancel button the only callback that is invoked is:
- (void)sharer:(id<FBSDKSharing>)sharer didCompleteWithResults:(NSDictionary *)results;
and not
- (void)sharerDidCancel:(id<FBSDKSharing>)sharer;
as expected. Furthermore using iOS8 the variable results is empty if the cancel button is pressed, otherwise it contains the post_id, but this does not happen with iOS7, where the result is always empty.
What am I doing wrong? What am I supposed to do to have the sharerDidCancel callback working properly?
Thanks for any help!