Skip to main content
The Share API allows you to share text content and URLs using the native share dialog on both iOS and Android.

Methods

share()

Opens a dialog to share text content. Content Parameter: The content object must contain at least one of url or message:
  • url (string, required on iOS): A URL to share
  • message (string, required on Android): A message to share (often includes a URL)
  • title (string, Android only): Title of the message
Options Parameter:
  • iOS:
    • subject (string): Subject to share via email
    • excludedActivityTypes (string[]): Activities to exclude from the share sheet
    • tintColor (ColorValue): Tint color of the share sheet
    • anchor (number): iPad only - anchor point for the popover
  • Android:
    • dialogTitle (string): Title of the share dialog
Returns: A Promise that resolves to an object with:
  • action (string): Either Share.sharedAction or Share.dismissedAction (iOS only)
  • activityType (string | null): The activity type that was used to share (iOS only)
Example:
iOS Example with Options:
Android Example:

Constants

Share.sharedAction

The content was successfully shared.

Share.dismissedAction

iOS only - The share dialog was dismissed without sharing.

Platform Behavior

iOS

  • Returns a Promise that resolves with action and activityType
  • If dismissed, the Promise still resolves with action being Share.dismissedAction
  • At least one of url or message is required
  • The subject option is used for email sharing

Android

  • Returns a Promise that always resolves with action being Share.sharedAction
  • activityType is always null
  • The message field is required and often includes the URL
  • Uses Android’s native share intent

Type Definitions