question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:11
  • Comments:8

github_iconTop GitHub Comments

3reactions
matiasbontempocommented, Feb 14, 2018

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!

3reactions
matiasbontempocommented, Feb 1, 2018

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use "Share image using" sharing Intent to share ...
Simple and Easiest code you can use it to share image from gallery. String image_path; File file = new File(image_path); Uri uri =...
Read more >
How to Share Image of Your App with Another App in Android?
Step 1: Create a new Project · Step 2: Working with the AndroidManifest.xml file.
Read more >
Sharing Files In Flutter - FlutterDevs
Use Share Package To share files In Flutter Apps ... and other we will convert the image URL to an image file and...
Read more >
Share files or apps with Nearby Share - Google Support
Share files or apps with Nearby Share · On your Android device, open Files by Google Files Go . · At the top...
Read more >
Sharing Content with Intents | CodePath Android Cliffnotes
String text = "Look at my awesome picture"; Uri pictureUri = Uri.parse("file://my_picture"); Intent shareIntent = new ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found