FBSDKSharing "didCompleteWithResults" delegate method in iOS

I used FBSDKSharing in my app. It is sharing perfect but i need to understand the user which button clicked. When i press cancel button or post button it returns to same delegate method which name is didCompleteWithResults.

Here is part of my code;

- (IBAction)shareButtonTapped:(id)sender {

FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
content.contentURL = [NSURL URLWithString:@"URL"];
[FBSDKShareDialog showFromViewController:self
                             withContent:content
                                delegate:self];

}

- (void)sharer:(id<FBSDKSharing>)sharer didCompleteWithResults:(NSDictionary *)results{

    NSLog(@"SHARED DONE= %@",results);

 }
- (void)sharerDidCancel:(id<FBSDKSharing>)sharer{
    NSLog(@"SHARED CANCELED");
}

- (void)sharer:(id<FBSDKSharing>)sharer didFailWithError:(NSError *)error{
    NSLog(@"SHARED ERROR = %@",error);
}

And i read some documents about it. In result dictionary, i can split these buttons event but, result dictionary returns empty dictionary.

Output;

SHARED DONE= {
}

What i am doing wrong?

Thanks for your answers and interests.

Sorry for my bad english 🙂


Source: facebook

Leave a Reply