1

I have implemented the FBNativeDialogs. Everything is working great except that I would like to know when the FBNativeDialogs is dismissed.

I know there is the handler but according to the documentation ( https://developers.facebook.com/docs/reference/ios/3.1/class/FBNativeDialogs/ FBShareDialogHandler ) FBShareDialogHandler defines a handler that will be called in response to the native share dialog being displayed. It is true that in other part of the same documentation they say the same handler is called when the dialog is dismissed. After some time spend on the matter, I found that the first statement is true.

So I am looking for a method to know that the FBShareDialogHandler has been dismissed. I have also tried viewDidDisappear but apparently it doesn't either.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Matthieu Rouif
  • 2,843
  • 1
  • 19
  • 28

2 Answers2

2

You set the handler when you call the method, it looks like this:

[FBNativeDialogs presentShareDialogModallyFrom:viewController initialText:@"Some text..." image:nil url:someUrl handler:^(FBNativeDialogResult result, NSError *error) {
            if (error) {

            } else {
                switch (result) {
                    case FBNativeDialogResultCancelled:
                        //The user has dismissed the dialog
                        break;
                    case FBNativeDialogResultSucceeded:
                        //The user shared
                        break;
                    case FBNativeDialogResultError:
                        //There was an error
                        break;
                }
            }
        }];
Zaid Daghestani
  • 8,555
  • 3
  • 34
  • 44
0

read at the end of the doc url you post ... an handler FBShareDialogHandler is called with FBNativeDialogResult enums. It lists FBNativeDialogResultSucceeded, FBNativeDialogResultCancelled, FBNativeDialogResultError so i suppose it will be called on close as well

(added)... ok you already try that

Luca Rocchi
  • 6,272
  • 1
  • 23
  • 23