Skip to main content
The ShareDialog component allows users to share content to Facebook through a native share dialog. It supports multiple content types including links, photos, and videos.

Methods

canShow

Checks if the dialog can be shown with the provided content.
ShareContent
required
The content to be shared. Can be ShareLinkContent, SharePhotoContent, or ShareVideoContent.
boolean
Returns true if the dialog can be shown, false otherwise.

Example

show

Shows the share dialog with the specified content.
ShareContent
required
The content to be shared. Can be ShareLinkContent, SharePhotoContent, or ShareVideoContent.
ShareDialogResult
A promise that resolves with the share result.
boolean
Whether the user cancelled the share dialog.
string
The ID of the post that was created (if successful).

Example

setMode

Sets the mode for the share dialog.
ShareDialogMode
required
The mode to use for the share dialog.iOS modes:
  • 'automatic' - Acts with the most appropriate mode that is available
  • 'browser' - Displays the dialog in Safari
  • 'webview' - Displays the dialog in a UIWebView within the app
  • 'native' - The native dialog is used
Android modes:
  • 'automatic' - The mode is determined automatically
  • 'native' - The native dialog is used
  • 'web' - The web dialog is used
  • 'feed' - The feed dialog is used

Example

setShouldFailOnDataError

Sets whether or not the native share dialog should fail when it encounters a data error.
boolean
required
If true, the dialog will fail when it encounters a data error. If false, it will continue.

Example

Types

ShareDialogMode

ShareDialogResult