React Native
How do I share content from a React Native app, including to Instagram Stories?
For text and links, call Share.share from React Native. For photos and other files, use expo-sharing's shareAsync with a file on the device. To open Instagram Stories directly, use react-native-share's shareSingle with your Facebook App ID, which needs a development build.
Updated October 31, 2026
If you’re adding a share button to a React Native app, how much work it takes depends on what you’re sharing and where it’s going. A link or a line of text needs nothing extra, and a photo just needs to be a file on the phone. Sharing straight into Instagram Stories is the one that takes setup, because it needs a library, a native build, and an app ID from Meta.
Which one to use
- Text and links: React Native’s built-in
Share, which opens the phone’s share sheet and works in Expo Go. - Photos and other files:
expo-sharing, which is part of the Expo SDK and also works in Expo Go. On iOS and Android it shares a local file. On the web it can’t share local files, so you’d share a link to an uploaded copy instead. - One specific app, such as Instagram Stories:
react-native-share, whoseshareSingleopens that app directly. It includes native code that isn’t in Expo Go, so you’ll need a development build.
How to share a link or text
import { Share } from "react-native";
async function sharePost(title: string, link: string) {
await Share.share({ message: `${title} ${link}` });
}
We’d put the link inside message, because that works on both platforms, while the separate url field is iOS only and title is Android only. On iOS, the result tells you whether the user shared or dismissed the sheet. On Android, the result is always Share.sharedAction, so you can’t tell whether they actually shared.
How to share a photo or file
import * as Sharing from "expo-sharing";
async function sharePhoto(fileUri: string) {
if (await Sharing.isAvailableAsync()) {
await Sharing.shareAsync(fileUri, { mimeType: "image/jpeg", dialogTitle: "Share photo" });
}
}
fileUri has to point at a file on the device, so if the image lives on a server, download it with expo-file-system first. mimeType only applies on Android, and the iOS equivalent is UTI.
How to share to Instagram Stories
-
Get a Facebook App ID by creating an app in Meta for Developers. Sharing to Instagram Stories has required one since January 2023, and without it the user sees “The app you shared from doesn’t currently support sharing to Stories”.
-
Install react-native-share and add its config plugin to
app.json. Theioslist addsinstagram-storiestoLSApplicationQueriesSchemes, the list of other apps’ link schemes your app is allowed to check for on iOS:{ "expo": { "plugins": [ [ "react-native-share", { "ios": ["instagram", "instagram-stories"], "android": ["com.instagram.android"] } ] ] } }Install it with
npx expo install react-native-share. -
Make a new development build, since the plugin changes native settings.
-
Share the image as a story:
import Share from "react-native-share"; await Share.shareSingle({ social: Share.Social.INSTAGRAM_STORIES, appId: "YOUR_FACEBOOK_APP_ID", backgroundImage: imageUri, });You can also pass
stickerImage, which can also be a base64data:URI, along withbackgroundTopColorandbackgroundBottomColor.
How you know it works
On a real phone with Instagram installed and signed in, tapping the button opens Instagram on the story editor with your image in place. The other share buttons open the share sheet with your text or photo.
If it doesn’t open Instagram
If nothing happens on iOS, check that instagram-stories is in the plugin’s ios list and that you rebuilt afterward. If Instagram opens and shows the “doesn’t currently support sharing to Stories” message, the appId is missing or isn’t a valid Facebook App ID. Some share options also don’t appear or work in the iOS simulator, so test on a real device.
Ask the agent
If your app is in Draftbit, paste this into the agent, and it can read your code and make the change for you.
Add a share button to the post screen that shares the post's title and link through the phone's share sheet. Also add a Share to Instagram Stories button that posts the post's image as a story, using our Facebook App ID.