### Setup Example App Source: https://github.com/achorein/expo-share-intent/blob/main/CONTRIBUTING.md Navigate to the example app directory, install its dependencies, and clean previous builds. ```sh cd example/basic yarn install yarn clean ``` -------------------------------- ### Run Example App on Android Source: https://github.com/achorein/expo-share-intent/blob/main/CONTRIBUTING.md Command to run the example application on an Android device or emulator. ```sh yarn android ``` -------------------------------- ### Run Example App on iOS Source: https://github.com/achorein/expo-share-intent/blob/main/CONTRIBUTING.md Command to run the example application on an iOS device or simulator. ```sh yarn ios ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/achorein/expo-share-intent/blob/main/CONTRIBUTING.md Run this command in the root directory to install all required dependencies for the project. ```sh yarn install ``` -------------------------------- ### Install expo-share-intent Source: https://github.com/achorein/expo-share-intent/blob/main/_autodocs/README.md Install the library using npm. This is the first step before using any of its features. ```bash npm install expo-share-intent ``` -------------------------------- ### Install expo-share-intent Source: https://github.com/achorein/expo-share-intent/blob/main/README.md Install the expo-share-intent package using either Yarn or npm. ```bash yarn add expo-share-intent # or npm install expo-share-intent ``` -------------------------------- ### Minimal Setup for Text & URLs Source: https://github.com/achorein/expo-share-intent/blob/main/_autodocs/configuration.md Configure app.json for basic sharing of text and URLs. This setup requires specifying the deep link scheme and including the plugin. ```json { "scheme": "my-app", "plugins": ["expo-share-intent"] } ``` -------------------------------- ### Install expo-linking Source: https://github.com/achorein/expo-share-intent/blob/main/README.md For Expo SDK 52 and later, install the expo-linking package. ```bash expo install expo-linking ``` -------------------------------- ### Complete Usage Example for Expo Share Intent Source: https://github.com/achorein/expo-share-intent/blob/main/_autodocs/api-reference-utils.md Demonstrates how to use the useShareIntent hook and utility functions to get the app scheme, share extension key, and parse share data within an Expo component. ```typescript import { useShareIntent, getScheme, getShareExtensionKey, parseShareIntent } from "expo-share-intent"; // In a component const { shareIntent } = useShareIntent(); // Get the app scheme const scheme = getScheme(); console.log(scheme); // "my-app" // Get the share extension key const extensionKey = getShareExtensionKey(); console.log(extensionKey); // "my-appShareKey" // Manually parse share data (usually done internally by the hook) const parsed = parseShareIntent(jsonString, { debug: true }); console.log(parsed.type); // "weburl", "text", "media", or "file", or null ``` -------------------------------- ### Example MainActivity Attributes for Share Intents Source: https://github.com/achorein/expo-share-intent/blob/main/_autodocs/plugin-reference.md This XML snippet shows an example of attributes applied to the MainActivity element in the AndroidManifest, including the `android:launchMode` attribute for proper share intent handling. ```xml ``` -------------------------------- ### iOS Activation Rules Example Source: https://github.com/achorein/expo-share-intent/blob/main/_autodocs/configuration.md Configure which content types trigger the share extension on iOS. Use predefined options or a custom predicate format. ```json "iosActivationRules": "SUBQUERY (predicateFormat)" ``` -------------------------------- ### Basic Setup with ShareIntentProvider Source: https://github.com/achorein/expo-share-intent/blob/main/_autodocs/api-reference-ShareIntentProvider.md Wrap your app with ShareIntentProvider and use the useShareIntentContext hook to access shared content and reset it. Ensure it's placed above components that need access to the share intent. ```typescript import { ShareIntentProvider, useShareIntentContext } from "expo-share-intent"; function Home() { const { hasShareIntent, shareIntent, resetShareIntent } = useShareIntentContext(); return ( {hasShareIntent && {shareIntent.text}}