support for react-native-share
complete
K
Kadir Güloğlu
I have share base64 pdf file. I need https://github.com/react-native-community/react-native-share library. please support
J
Jose Solorio
I want to be able to share an image to INstagram but it now requires an AppId.
However, i dont have a MAC.
Please allow this!
Wodin
Jose Solorio: You don't need a Mac. Please elaborate on the AppId requirement?
Marc Habib
Still not working on this date ( for shareSingle ).
It redirects me everytime to the app store page of the app targeted. Seems like it doesn't know that the app has been installed. Many answers to that question on google are to update info.plist and list the application you need.
Wodin
Marc Habib: If you need to update
Info.plist
you can do that in app.json
with ios.infoPlist
.Marc Habib
Wodin: 🥲🙏🏼
Evan Bacon
complete
This works in EAS Build / Custom Dev Clients without needing any Config Plugin. Just install and build!
Added it to the list of known packages that work without a config plugin:
Marc Habib
Evan Bacon: I don't understand why it is marked as complete, but still can't use it on Expo Managed project ?
Wodin
Marc Habib: You
can
use it in a managed project. There's no need to eject to the bare workflow. You just can't use it in Expo Go and you can't build with the classic expo build
.Instead of Expo Go, you need to build a development client, and when you're ready to build the production version, you also need to use EAS Build.
Marc Habib
Wodin: Thanks for the answer.
I have another question, I've built a development client, then installed react-native-share, tried to use it but not working.
Do I have to rebuild the app or it should work without rebuilding ?
Wodin
Marc Habib: If you add a dependency that
only
consists of JavaScript code then you should not have to rebuild. But anything involving native code (like react-native-share
) will require a rebuild of the dev client/production app. If you're unsure, rebuild. This might be a nuisance, but there's no way around it.A possible workaround is: You could add all the dependencies that you think you will need in the future up front. Then you can just add the JavaScript code to make use of those dependencies over time without having to rebuild. This is similar to the Expo SDK + classic
expo build
, but it means your app is bigger than it needs to be because it includes a bunch of native code that you're not actually using (yet?).Marc Habib
Wodin: thank you. Everything is clear for me now 😁
Dom Barker
Evan Bacon: no longer true :( https://github.com/react-native-share/react-native-share/issues/1240
Wodin
Dom Barker: Are you sure? Here's an Expo app using react-native-share that works fine for me:
Marc Habib
Wodin: Just cloned the repo, everything works except the shareSingle method, which redirect me to the app store page of the app, event if I already have the app.
Wodin
Marc Habib: I have not tested with Expo SDK 46 on iOS, but I am pretty sure it worked for me before on SDK 45 on the Simulator. Either way it seems like something you would probably have to talk to the react-native-share author about.
Marc Habib
Wodin: I'm on SDK 45 on a real device, I think on a simulator it's not possible to download social media because there's no appstore
Tom Scanlan
Evan Bacon: Using the package in Expo Go results in an error. Even if it works after an EAS build I don't think this is sustainable. Is there any way we can get full support? I don't think we should mark this complete.
Tom Scanlan
Wodin: I know this repo wasn't meant to run on Expo Go but I downloaded it and still see an error when I run it. I understand that right now we need to go through EAS build to use rn-share but this doesn't prevent me from getting errors when developing locally on Go or my simulator. Is there a way to get around it? Will we ever add support in go for this?
Wodin
Tom Scanlan: Expo Go does not include the native code needed by react-native-share.
You should build a custom development client and use that instead of Expo Go.
A custom development client is basically a version of Expo Go that is built with just
your
dependencies.So if you install react-native-share before building the dev client, it will include the native code needed by react-native-share.
Wodin
Tom Scanlan: To build a dev client for the simulator you can add an EAS Build profile to your
eas.json
that has "simulator"
set to true
.See the following gist for an example:
Then you can build with:
eas build -p ios --profile sim-dev
When it's built, download it, extract the .app from the downloaded .tar.gz file and drag the app onto your simulator to install it.
Then run that instead of Expo Go.
Naveen Prasanth K
Evan Bacon: Hi, Yes it is working properly in Build. No need of any configuration.. Thank you...
Fernando Rojo
I assume this is now possible with EAS. cc Brent Vatne
Wodin
Fernando Rojo: Yes, based on the installation instructions for
react-native-share
it looks like it should work out of the box with EAS Build without the need for a config plugin.Filipe Prata de Lima
This is a very needed library, it's been a make or break for multiple projects.
R
Rewaant Chhabra
+1 This would be so much better to have as the expo's Sharing API and React Native's Share api lack some required functionality which is quite basic and supported in react-native-share.
Sethu Senthil
Yes please, this will also solve many other requests as that library contains almost all share features one would desire!
Daniel
Is this not enough https://docs.expo.io/versions/latest/react-native/share, because it only shares text?
T
Tom
Daniel: No, you can share both files and text with expo-sharing, but you can't share both at the same time. react-native-share lets you share a file with a message as a caption, for example a photo file with a message "look at this". At the moment, expo-sharing does not do this. Therefore, they need to add this functionality to expo-sharing or make Expo compatible with react-native-share.