This extension allows you to easily add your applications icon to the iOS share sheet of other applications like Safari. It wil handle (nearly) all the for you, like registering the iOS Share Extension and enables Deep Linking.
Install it in your project:
expo install expo-config-plugin-ios-share-extension
In your app’s Expo config (app.json, or app.config.js), make sure that expo-config-plugin-ios-share-extension
has been added to the list of plugins. Under scheme, define your apps scheme.
"expo": {
"name": "my-app",
"scheme": "myapp",
"plugins": [
["expo-config-plugin-ios-share-extension"]
]
}
Currently there is a bug in the package xcode
this library depends on. For now a workaround is needed, where the xcode
package get's patched automatically.
- Run §npm install --save-dev package-patch§
- Copy this repo's patch folder to the root of the project
- Add
"postinstall": "patch-package"
to the scripts section in package.json.
To determine which URL was passed to your application, you can read the app open url.
import { useURL } from "expo-linking";
import { Text } from 'react-native';
export default function App() {
const url = useURL();
return <Text>URL: {url}</Text>;
}
The format of the url is: [schema]://share/?url=[shared url]
Next, rebuild your app.
eas build --profile development --platform ios
- Currently, only URL receiving is supported
- Only support directly redirect to Containing app.
- Here's an article that explains why this approach was chosen.
- Support receiving more content types
- Support Android
This plugin was inspired by: