Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add share images support #9817

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

Closed
Tracked by #82
xster opened this issue May 4, 2017 · 34 comments
Closed
Tracked by #82

Add share images support #9817

xster opened this issue May 4, 2017 · 34 comments
Labels
c: new feature Nothing broken; request for a new capability customer: crowd Affects or could affect many people, though not necessarily a specific customer. customer: posse (eap) p: share The Share plugin P3 Issues that are less important to the Flutter project package flutter/packages repository. See also p: labels.

Comments

@xster
Copy link
Member

xster commented May 4, 2017

#9816 only supports sharing text/links. Embedded image support

@eseidelGoogle eseidelGoogle added this to the 3: Make conferences happy milestone May 4, 2017
@xster
Copy link
Member Author

xster commented May 7, 2017

@chinmaygarde looking for some advice to make sure I'm heading in the right direction.

I assume I'd want to expand the sharing Dart API (flutter/plugins#21) to also take in a ui.Image (or some async wrapper of it) in the share method. Get its corresponding CanvasImage's bytes on the other side and then make a UIImage with it?

@abarth
Copy link
Contributor

abarth commented May 7, 2017

What is the actual use case you're trying to address? ui.Image represents a (possibly deferred) GPU-resident image. If you want to share images from storage (e.g., the user's photo gallery), there might not be a reason to make them GPU-resident. You might want something more like a file descriptor or some other handle to bytes (potentially not memory-resident at all).

@xster
Copy link
Member Author

xster commented May 7, 2017

Sorry, didn't mean to get you to answer on Sunday.

Thanks, that's the part I wasn't sure. I was trying to see if there were a central point that users already use to show images like ImageProvider that I can reuse to get bytes across in an efficient way to share everything from NetworkImages and stuff from the gallery.

It seemed like all the actual bytes were stored in ui.Image in common with ImageProviders. Might be easier in person. I'll come chat with you in the morning.

@abarth
Copy link
Contributor

abarth commented May 7, 2017

Sounds good.

@eseidelGoogle
Copy link
Contributor

@lukef mentioned this morning that Posse was likely to use/build share-sheet integration which would want to share images.

@eseidelGoogle
Copy link
Contributor

Posse is now tech'd up on Plugins so this is no longer blocking them. They currently believe they can build this themselves.

@eseidelGoogle eseidelGoogle modified the milestones: 4: Make shippers happy, 3: Make conferences happy May 22, 2017
@Hixie Hixie added the plugin label May 23, 2017
@xster
Copy link
Member Author

xster commented Nov 15, 2017

Sounds like Posse has a custom implementation that shares image files, though they'll still be interested in sharing image bytes.

@Purus
Copy link

Purus commented Feb 28, 2018

+1 for this request.

The plugin should support sharing both local and network images along with text.

@Sun3
Copy link

Sun3 commented Apr 16, 2018

Checking to see if support to share both Text and Images is on the roadmap and possible timeline? We have an app we are developing which needs both.

Thanks.

@Purus
Copy link

Purus commented Apr 17, 2018 via email

@Sun3
Copy link

Sun3 commented Apr 24, 2018

ps: @Purus I have noticed that most plugins do not work in iOS with Swift 4 projects enabled.

This is the Error:

Launching lib/main.dart on iPhone X in debug mode...
Xcode build done.
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
The use of Swift 3 @objc inference in Swift 4 mode is deprecated. Please address deprecated @objc inference warnings, test your code with β€œUse of deprecated Swift 3 @objc inference” logging enabled, and then disable inference by changing the "Swift 3 @objc Inference" build setting to "Default" for the "Runner" target.
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
/Users/marco/Documents/Flutter Projects/plugins_playground/ios/Runner/GeneratedPluginRegistrant.m:6:9: fatal error: 'share/SharePlugin.h' file not found
#import <share/SharePlugin.h>
^~~~~~~~~~~~~~~~~~~~~
1 error generated.
Could not build the application for the simulator.
Error launching application on iPhone X.
Exited (sigterm)

Thanks.

@modulovalue
Copy link

any updates on this? @Purus

@m-zeki
Copy link

m-zeki commented Aug 19, 2018

will this issue be address soon? @Purus - or is there any other way to share an image file with a flutter app?

@jorgevvr
Copy link

Please, add support for sharing image or files, is hard to call specific api to who haven't experience with IOS for example. Like me lol.

@DenisStark77
Copy link

+1 for the sharing images in Share plugin

@PieterAelse
Copy link

Should this help? https://stackoverflow.com/questions/44181343/how-do-i-share-an-image-on-ios-and-android-using-flutter

The answer from Simon has a Swift and Kotlin version.
The answer from Albert Lardizabal has Objective-C and Java version.

@d-wolf
Copy link

d-wolf commented Nov 21, 2018

We put that functionality into a plugin: https://pub.dartlang.org/packages/esys_flutter_share.

final ByteData bytes = await rootBundle.load('assets/image.png');
await EsysFlutterShare.shareImage('myImageTest.png', bytes, 'my image title');

@jorgevvr
Copy link

@d-wolf Thank you for your help, i will try it soon.

@amirh amirh added the c: new feature Nothing broken; request for a new capability label Dec 21, 2018
@higorlapacw
Copy link

Any news?

@kf6gpe kf6gpe added the P2 Important issues not at the top of the work list label May 29, 2020
@kf6gpe kf6gpe removed this from the Goals milestone Jun 2, 2020
@Hixie Hixie removed this from the Goals milestone Jun 2, 2020
@maheshkumar2150
Copy link

Any News?

@allanwolski
Copy link

allanwolski commented Aug 17, 2020

Waiting to be merged
flutter/plugins#970

@Hixie Hixie removed this from the None. milestone Aug 17, 2020
@ditman
Copy link
Member

ditman commented Aug 28, 2020

share: ^0.6.5 has been tagged and published! (Feel free to reopen if needed)

@ditman ditman closed this as completed Aug 28, 2020
@ditman
Copy link
Member

ditman commented Aug 28, 2020

(I'm going to reopen, because I see that part of the requirement was to share from bytes; flutter/plugins#970 is based on paths.)

@ditman ditman reopened this Aug 28, 2020
@chinmaygarg
Copy link

Any plugin in which I can share an app deep link with the offline image preview (base64) ?

@stuartmorgan-g stuartmorgan-g added P6 and removed P2 Important issues not at the top of the work list labels Feb 4, 2021
@Trulsmatias
Copy link

Any updates on the option to share from bytes?

@MiguelSOliveira
Copy link

Hey guys, I see that this was merged: flutter/plugins#970

But I can't seem to find Share.shareFile method using share: ^2.0.1 in master? Can anyone help me? Was this reverted?

@ditman
Copy link
Member

ditman commented Apr 28, 2021

@MiguelSOliveira
Copy link

Hey @ditman, please correct me if I'm wrong, but I don't think that one will work as I want to share a memory "File" type, and that one takes a path to a file instead.

The link I provided works because it takes a "File" type variable, which is exactly what I want.

image

@ditman
Copy link
Member

ditman commented Apr 28, 2021

@MiguelSOliveira take a look at what was finally merged, I think the code you want is:

Share.shareFiles(['${directory.path}/image.jpg']);

No need to instantiate the File to share it (?)

@MiguelSOliveira
Copy link

you're totally right @ditman, I have to store and write to the file anyways so it's physically in the temporary directory and I can just use that path. Thanks!

@GoelBiju
Copy link

Any updates on the option to share from bytes?

It would be nice to have support for sharing from bytes.

@stuartmorgan-g
Copy link
Contributor

Closing, as share is now deprecated in favor of share_plus.

@github-actions
Copy link

github-actions bot commented Aug 1, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 1, 2021
@flutter-triage-bot flutter-triage-bot bot added P3 Issues that are less important to the Flutter project and removed P6 labels Jun 28, 2023
@flutter-triage-bot flutter-triage-bot bot added the package flutter/packages repository. See also p: labels. label Jul 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: new feature Nothing broken; request for a new capability customer: crowd Affects or could affect many people, though not necessarily a specific customer. customer: posse (eap) p: share The Share plugin P3 Issues that are less important to the Flutter project package flutter/packages repository. See also p: labels.
Projects
None yet
Development

No branches or pull requests