Skip to content
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

How to share image/file to another app(using Share.share)? #17682

Closed
monkingame opened this issue Jan 20, 2018 · 8 comments
Closed

How to share image/file to another app(using Share.share)? #17682

monkingame opened this issue Jan 20, 2018 · 8 comments
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@monkingame
Copy link

Is this a bug report?

maybe

Have you read the Contributing Guidelines?

yes

Environment

Environment:
OS: macOS High Sierra 10.13.2
Node: 9.3.0
Yarn: 1.3.2
npm: 5.6.0
Watchman: 4.9.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 3.0 AI-171.4443003

Packages: (wanted => installed)
react: 16.2.0 => 16.2.0
react-native: 0.52.0 => 0.52.0

Target Platform: iOS (10.3),Android(7.1.1)

Steps to Reproduce

1.create base64 string or local filename
2.use Share.share option
3.
` const content = {
message: ICON_PLUS_BASE64,
//or: message: 'file:///data/0/tmp/..........',
title: 'share',
url: ICON_PLUS_BASE64,
};
const option = { dialogTitle: 'title title title' };
Share.share(content, option);

const ICON_PLUS_BASE64 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADMAAAAzCAYAAAA6oTAqAAAAEXRFWHRTb2Z0d2FyZQBwbmdjcnVzaEB1SfMAAABQSURBVGje7dSxCQBACARB+2/ab8BEeQNhFi6WSYzYLYudDQYGBgYGBgYGBgYGBgYGBgZmcvDqYGBgmhivGQYGBgYGBgYGBgYGBgYGBgbmQw+P/eMrC5UTVAAAAABJRU5ErkJggg==';
`

Expected Behavior

(Write what you thought would happen.)
App will share(maybe export is more accurate) the image to another app(eg,iMessage,evernote,wechat,etc)

Actual Behavior

The destination app only receive string message but not image.

Reproducible Demo

https://snack.expo.io/@monkingame/test-share

@matiasbontempo
Copy link

I'm experiencing the same behaviour when sharing using whatsapp. When sharing with email the file is attached but with no extension.

@lucasbento
Copy link
Contributor

@matiasbontempo: what did you end up using? I keep finding your comments in multiple places with the same errors that I'm experiencing. 😄

@matiasbontempo
Copy link

Hey @lucasbento! Sadly, I have no updates. I might try to take a look at the code and try to solve it myself but I have no experience with iOS native code. If I have any kind of success I'll create a PR and let you know!

@react-native-bot
Copy link
Collaborator

Thanks for posting this! It looks like you may not be using the latest version of React Native, v0.53.0, released on January 2018. Can you make sure this issue can still be reproduced in the latest version?

I am going to close this, but please feel free to open a new issue if you are able to confirm that this is still a problem in v0.53.0 or newer.

How to ContributeWhat to Expect from Maintainers

@react-native-bot react-native-bot added Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon. labels Feb 24, 2018
@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Feb 24, 2018
@lucasbento
Copy link
Contributor

For anyone that's having a problem with this, I used file sharing with react-native-fetch-blob and react-native with PR react-native-share/react-native-share#215.

@sturmenta
Copy link

@lucasbento Did you have a problem installing react-native-share? After installing my app crashes
https://stackoverflow.com/questions/49392736/react-native-build-successful-but-app-crashes

@lucasbento
Copy link
Contributor

@sturmenta: your link is giving 404, if you still need help I think it's better to create an issue on react-native-share.

@sturmenta
Copy link

@lucasbento Sorry, delete the stackoverflow post because I did not have any kind of way to show the error I doubted they could help me, finally I had problems in the AndroidManifest.xml with the provider. This is the link to how I solved the problem published as an issue in react-native-share: react-native-share/react-native-share#227.

Thanks also for your help. Regards!

@facebook facebook locked as resolved and limited conversation to collaborators Feb 24, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Feb 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants