Reputation: 4753
This question has been asked many times on stack overflow, but never for apps generated using the expo framework, which makes my app specific and incompatible with replies from other posts.
How can I make my expo app appear in the share list of another app? It seems the docs don't address this topic.
Upvotes: 9
Views: 4213
Reputation: 87
You can!
Use the expo-share-intent library with Expo to enable sharing URLs, text, images, videos, and files in your iOS and Android apps.
This library provides a simple native module for Expo to handle sharing functions.
Upvotes: 0
Reputation: 2570
We had tried to do it for a couple of days, There is only one solution that we found that really works
https://www.npmjs.com/package/expo-share-intent
You even don't need to work in a bare workflow, however you need to run dev build it's not working with ExpoGo
Upvotes: 0
Reputation: 1
Using the configuration in app.json and specifically the android.intentFilters key,
"intentFilters": [
{
"action": "SEND",
"data": [
{
"mimeType": "text/plain"
}
],
"category": ["DEFAULT"]
}
]
(more here https://docs.expo.dev/versions/v48.0.0/config/app/#intentfilters)
I have managed to make my app appear in the share list. However, I don't know and can't find how to get the data sent from the other app.
Any help about how to handle the received data in react?
Upvotes: 0
Reputation: 13067
You can't.
At least not in the expo managed workflow at the time I'm writing this. If that's crucial for your app, you can eject, move to the bare workflow and give react-native-share-extension a shot.
PS: There's a feature request. I hope they'll implement it in the (near) future.
Upvotes: 4