-
Notifications
You must be signed in to change notification settings - Fork 24.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Share does not support url
on Android
#18993
Comments
Experiencing this issue as well in our app. Did a bit of digging into the React Native source code and you can find the js function used to share content here: react-native/Libraries/Share/Share.js Line 65 in 4a80210
That ties in with the ShareModule on Android. I had a look through the code and found it's only looking for title and message in the share content. Title react-native/ReactAndroid/src/main/java/com/facebook/react/modules/share/ShareModule.java Line 60 in 26684cf
Message react-native/ReactAndroid/src/main/java/com/facebook/react/modules/share/ShareModule.java Line 64 in 26684cf
For the ShareModule to work with images on Facebook it would need something like this added
I did a couple of tests with apps on my Pixel 2 and this code allows you to share a text and image for:
Or just an image for:
I think the only thing which needs to be passes from the Share.js is the uri or a location to generate the uri ( In my opinion should be two functions in Share.js because I know not everyone will want to show an image, so there should be |
@MarkOSullivan94 what about sharing a file? Could you submit a PR if you know how to fix it? The implementation from react-native-share seems non-trivial. |
Honestly I have no idea how I would go about testing my changes. I've just done a bit of reading up on contributing to the project but after reading up on the How to Contribute guide, I walked away not knowing how I'm supposed to be able to run my changes to the RN project with my existing RN projects. I tried messaging in the #need-help channel and the #react-native channels in the Reactiflux discord server seeking advice but got no response. Edit: I found a document to explain how to test changes! Might look into trying to see if I can get a fix for this in the next couple of weeks. |
I really need to share a url on Android. Because Facebook is showing nothing! And what's the meaning for this whole Share module if there is nothing to share. |
I honestly think this is a huge lack for this module, I can't believe it.. The @MarkOSullivan94 solution involves native "hacks", so even if it works it can't be used inside Expo. |
@antonioaltamura what you mean it wont work with Expo? |
Uhm I saw java edits and I thought they were in |
Have been unable to test my changes to the RN project for this. Hopefully once I get help with my issue (#19358), I'll be able to get my changes to work, allowing for the sharing of images for Android in RN Share API. |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions. |
stale-- |
Hit another block #21776 |
Another block hit #22118 I would be great if someone with a running local build of React Native can test these changes for me. |
Hello there 👋 this issue seems more of a precise feature request than a bug report. For this reason, we'd prefer for you to post it to Canny so that it can be prioritized against the FR already there (maybe someone already submitted it!), or you can create a pull request 👍 |
@Titozzz I think it would be a good idea for you to post it to Canny first and then link it in here before closing this issue, means you wont have numerous people who read your post going there and posting the same idea over and over again. |
Environment
Environment:
OS: macOS Sierra 10.12.6
Node: 9.8.0
Yarn: -
npm: 5.6.0
Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.1 => 0.55.1
Steps to Reproduce
https://facebook.github.io/react-native/docs/share.html#ios
Why does it only support
url
prop on iOS? Is there some other way to share a file on Android?The text was updated successfully, but these errors were encountered: