--- title: Sharing description: Learn more about the Sharing action in App Bridge. api_name: app-bridge source_url: html: https://shopify.dev/docs/api/app-bridge/previous-versions/actions/share md: https://shopify.dev/docs/api/app-bridge/previous-versions/actions/share.md --- ExpandOn this page * [Requirements](https://shopify.dev/docs/api/app-bridge/previous-versions/actions/share#requirements) * [Setup](https://shopify.dev/docs/api/app-bridge/previous-versions/actions/share#setup) * [Share Close action](https://shopify.dev/docs/api/app-bridge/previous-versions/actions/share#share-close-action) * [Subscribe to Share Close:](https://shopify.dev/docs/api/app-bridge/previous-versions/actions/share#subscribe-to-share-close) * [Share Open action](https://shopify.dev/docs/api/app-bridge/previous-versions/actions/share#share-open-action) # Sharing Note This is a legacy API. Use the latest version of [`Share`](https://shopify.dev/docs/api/app-home/apis/share) instead. The `Share` action allows you to invoke the "share sheet" to share content from your embedded app on an iOS or Android device. ![A simplified drawing of a smartphone. on the phone's screen is a graphic of an ios share sheet.](https://cdn.shopify.com/shopifycloud/shopify-dev/production/assets/assets/images/apps/tools/app-bridge-sharing-B0-noZw7.png) *** ## Requirements These actions require the following app versions: * **Shopify iOS v8.22.0** or above * **Shopify Android v8.25.0** or above * **Point of Sale iOS v5.29.0** or above * **Point of Sale Android v3.24.0** or above *** ## Setup Create an app and import the `Share` module from `@shopify/app-bridge/actions`. Note that we'll be referring to this sample application throughout the examples below. Note In the following example, `config` is a valid App Bridge configuration object. Learn more about [configuring App Bridge](https://shopify.dev/docs/api/app-bridge/previous-versions/app-bridge-from-npm/app-setup#initialize-shopify-app-bridge-in-your-app). ```js import createApp from '@shopify/app-bridge'; import {Group, Share} from '@shopify/app-bridge/actions'; var app = createApp(config); var share = Share.create(app); ``` *** ## Share Close action | Group | Share | | - | - | | Action | CLOSE | | Action Type | APP::SHARE::CLOSE | | Description | Dispatches after closing the Share Sheet. | The `Share` action lets you share content from your app to any third-party app on the user's device, as long as the app supports the payload type. Some apps only support text and some support URLs and text. *** ## Subscribe to Share Close: ```js share.subscribe(Share.Action.CLOSE, function (payload) { // The payload will contain `success` as its only property. This is set to `true` upon a successful share and set to `false` if the action is canceled. }); ``` ### Response | Key | Type | Description | | - | - | - | | `success` | Boolean | Whether the share was successful or canceled. | *** ## Share Open action | Group | Share | | - | - | | Action | SHOW | | Action Type | APP::SHARE::SHOW | | Description | Opens a Share Sheet that allows you to share content with other apps. | ```js share.dispatch(Share.Action.SHOW, { text: 'Hey check this out!', url: 'https://www.reallyawesomesite.com', }); ``` Note Note: In Debug Mode, `text` and `url` are optional but at least one needs to be included in the payload. If neither are present then an `APP::ERROR::INVALID_PAYLOAD` will be thrown or sent to an Error subscriber. However, in Production Mode this will silently fail. ### Request | Key | Type | Description | | - | - | - | | `text` | String? | The text to share. | | `url` | String? | The URL to share. | *** * [Requirements](https://shopify.dev/docs/api/app-bridge/previous-versions/actions/share#requirements) * [Setup](https://shopify.dev/docs/api/app-bridge/previous-versions/actions/share#setup) * [Share Close action](https://shopify.dev/docs/api/app-bridge/previous-versions/actions/share#share-close-action) * [Subscribe to Share Close:](https://shopify.dev/docs/api/app-bridge/previous-versions/actions/share#subscribe-to-share-close) * [Share Open action](https://shopify.dev/docs/api/app-bridge/previous-versions/actions/share#share-open-action)