The FBDialogDelegate protocol defines the methods that a delegate of a Facebook object may implement. These methods are defined in FBDialog.h.
The protocol declares methods that are implemented by your application to handle Platform Dialog callbacks. All the methods defined in this protocol are optional.
You should implement the methods if you want to handle one or more of the following scenarios:
The dialog completes successfully.
The dialog fails due to an error.
The user cancels the dialog.
The user clicks on a link in the dialog that would a browser and you wish to intercept this.
Sent to the delegate when the dialog succeeds and is about to be dismissed.
- (void)dialogDidComplete:(FBDialog *)dialog;
Parameters
dialog - The dialog that succeeded.
Notes
This method is invoked after the dialog succeeds and is about to be hidden. You can use this method to handle the success path of the dialog flow.
Sent to the delegate when the dialog is cancelled and is about to be dismissed.
- (void) dialogDidNotComplete:(FBDialog *)dialog;
Parameters
dialog - The dialog that was cancelled.
Notes
This method is invoked after the dialog is cancelled by clicking the "x" icon and is about to be hidden. You can use this method to handle the cancel path of the dialog flow.
Sent to the delegate when the dialog succeeds with a returning url.
- (void)dialogCompleteWithUrl:(NSURL *)url;
Parameters
url - The return URL.
Notes
You can use this method to handle return URLs when the user interacts with the dialog, that is, if the user clicks the cancel or submit (Send/Share) button. Check the return URL for the expected parameters to determine if the user clicked Cancel. If a request is successfully sent, a request parameter is part of the return URL. If a story is successfully posted, a post_id parameter is part of the return URL.
Sent to the delegate when the dialog get canceled by the user.
- (void) dialogDidNotCompleteWithUrl:(NSURL *)url;
Parameters
url - The return URL.
Notes
You can use this method to handle return URLs when the dialog is cancelled by the user when the "x" icon is clicked.
Sent to the delegate when the dialog failed to load due to an error.
- (void)dialog:(FBDialog*)dialog didFailWithError:(NSError *)error;
Parameters
dialog - The dialog that failed.
error - The error information.
Notes
This method is invoked after there is an error during the dialog process. You can use this method to handle the error path of the dialog flow.
Sent to the delegate to check if a link touched by a user should be opened in an external browser.
- (BOOL)dialog:(FBDialog*)dialog shouldOpenURLInExternalBrowser:(NSURL *)url;
Parameters
dialog - The dialog currently being displayed.
url - The URL that is being linked to.
Return Value
A boolean indicating whether to open the link in a browser.
Notes
This method is invoked when a user taps on a link that is meant to open in a browser. You can implement this method to change that behavior such as displaying a confirmation message before navigating to the browser or suppressing the browser launch.