The Facebook SDK provides powerful sharing capabilities that allow users to share content from your app to their Facebook timeline.
Share Dialog
The Share Dialog is the recommended way to share content. It provides a native sharing experience and doesn’t require additional permissions.
Sharing Links
Advanced Link Sharing
Add hashtags, quotes, and other metadata:
Sharing Photos
Share photos from your app to Facebook:
Multiple Photos
Share multiple photos at once:
Photos with User Tagging
Sharing Videos
Share videos with optional preview photos and metadata:
Share Dialog Configuration
Setting Dialog Mode
Control how the share dialog is displayed:
Automatic (Recommended)
Native
Web (Android)
Browser (iOS)
Error Handling
Configure whether the dialog should fail on data errors:
Share API
The Share API requires your app to have the publish_actions permission approved. For most use cases, use Share Dialogs instead for an easier and more consistent experience.
Complete Examples
Link Sharing Component
Photo Sharing Component
ShareContent Types
ShareLinkContent
SharePhotoContent
ShareVideoContent
Common Parameters
API Reference
ShareDialog Methods
ShareDialogResult
Best Practices
- Always check canShow() before attempting to show the share dialog
- Use ShareDialog instead of ShareApi for better user experience and no permission requirements
- Keep hashtags under 32 characters or they will be truncated
- Provide high-quality images for better engagement
- Test on both platforms as some features behave differently on iOS vs Android