Skip to main content
The FacebookShare SDK gives your app the ability to post content to Facebook on behalf of the user. You can share links with quoted text, photos from memory or the photo library, and videos — all through a single consistent ShareDialog interface.

What you can share

Content typeClassDescription
LinksShareLinkContentA URL with optional quote text and a hashtag
PhotosSharePhotoContentUp to 10 photos from UIImage, a file URL, or a PHAsset
VideosShareVideoContentA single video from a file URL, raw Data, or a PHAsset
Mixed mediaShareMediaContentA combination of photos and at most one video

Share modes

ShareDialog supports several presentation modes, controlled by the mode property:
  • Automatic (default) — the dialog selects the best available mode at runtime, preferring the native Facebook app when installed.
  • Native — opens the share sheet inside the Facebook app. Requires the Facebook app to be installed.
  • Share sheet — uses the iOS integrated share sheet (SLComposeViewController). Requires the Facebook app.
  • Browser — opens the share dialog in Safari.
In most cases you should leave the mode set to .automatic and let the SDK choose.

Required SDK

Add FacebookShare to your project. If you use Swift Package Manager, add the FacebookShare product from the Facebook iOS SDK package. For CocoaPods, add the FBSDKShareKit pod to your Podfile.
import FacebookShare
FacebookShare depends on FacebookCore. Both are included when you add FacebookShare through either package manager.

Pages in this section

Share dialog

Present a share dialog, choose a mode, and handle the delegate callbacks.

Share link content

Build link payloads with quotes and hashtags.

Photos and videos

Share images, videos, and mixed media.

Build docs developers (and LLMs) love