facebook-ios-sdkfacebook-messengerfacebook-messages

fbsdkmessagedialog callback for iOS


I'm new to IOS programming, I'm trying to send message to Facebook friends using the below

[FBSDKMessageDialog showWithContent:content delegate:(id)self];

I have added callback as below:

- (void)sharer:(id<FBSDKSharing>)sharer didCompleteWithResults:(NSDictionary *)results
{
    NSLog(@"complete");
}

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

But the sharer method is not called when I send a message in FB messenger rather the sharerDidCancel is called. The sharerDidCancel method is called when user cancels or send a message, how can I differentiate send vs cancel?


Solution

  • Facebook has a confirmed bug concerning this, however the addressed bug there is that it always calls sharer:didCompleteWithResults instead of sharerDidCancel.

    Their next release contain a fix for this (v45) and hopefully this fixes our bug too (I'm having the same problem).