-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[share] Add sharing file support (android & ios) #970
Conversation
Hi @pboos! What a nice work! Thank you very much for sharing, I find this completely necessary for the plugin! iOS
Android |
Great job @pboos! It would be perfect if had an option for multiple files like this Could you add that? |
I'm having issues sharing image files with WhatsApp on iOS. On Android it's working fine, is there any specific thing that needs to be done in order to share in WhatsApp? |
When will this be merged? |
When will this be merged? |
using the dependency as described by @pboos does not seem to work anymore with the migration away from android support library
|
@pboos Hi, I'm an user of your great work. Thank you. I appreciate your great effort. It can be better if you make it to be merged. I wish it become true. Thank you. |
Using this plugin in the way that @pboos described is giving a conflict with AndroidX. |
I found it easy to refactor the plugin according to https://flutter.dev/docs/development/packages-and-plugins/androidx-compatibility as well as changing the NonNull and FileProvider to the latest imports in the SharePlugin.java-file: |
At first glance looks like a solid change, and lots of thumbs on the PR. Conflicts need to be resolved. Created flutter/flutter#36894 to track getting this merged, if this feature is something you need please thumbs up that issue. |
@collinjackson anything we can do to help this along? |
What do I have to do to get this merged in? It seems like several people are interested in this and it would make it easier if it was merged into the official share plugin. |
I also have problem conflict with AndroidX. My project not use AndroidX `Attribute meta-data#android.support.FILE_PROVIDER_PATHS@resource value=(@xml/filepaths) from [:open_file] AndroidManifest.xml:20:17-50 FAILURE: Build failed with an exception.
BUILD FAILED in 19s` |
@pboos: I tried to fix the conflicts (your repo is 500+ commits behind upstream), but unfortunately I couldn't make the plugin work. Would you mind fixing the conflicts (it seems to me that it shouldn't be too much work)? Also Flutter is complaining about AndroidX in my case, and it seems like this should be addressed as well. Finally, the CI is all passing expect for the CLA saying: "CLAs are signed, but unable to verify author consent". Did you do everything on your side? I believe that the Flutter team won't be able to merge unless this test is passing. It seems like the Flutter team doesn't have much resources to look into PRs, since this one has been waiting for more than a year. But at least if it was in a mergeable state, there would be a chance of it being merged some day 😊. Currently it is not. |
I have updated my branch and rebased to a commit from two weeks ago (as of now the most recent). The many conflicts were due to the reason that the master share plugin was migrated to android plugin v2 and androidx. I now adjusted the code to that version. Might require a new review of the code since especially the ios part changed a log (made it closer to the new version and as well fixed a bug that was there in the old version of my pull request). Any further input to get this merged would be great. |
@ditman did the corrections you suggest. I agree the |
packages/share/android/src/main/java/io/flutter/plugins/share/Share.java
Outdated
Show resolved
Hide resolved
packages/share/android/src/main/java/io/flutter/plugins/share/Share.java
Outdated
Show resolved
Hide resolved
packages/share/android/src/main/java/io/flutter/plugins/share/Share.java
Outdated
Show resolved
Hide resolved
packages/share/android/src/main/java/io/flutter/plugins/share/Share.java
Outdated
Show resolved
Hide resolved
packages/share/android/src/main/java/io/flutter/plugins/share/Share.java
Outdated
Show resolved
Hide resolved
@pboos Thanks for the PR! It looks good overall. I left some comments around java and objc implementations. |
@cyanglaz Thanks a lot for the great comments. I acted on them and now the code should be a lot better :). You caught some embarrassing bugs that snuck their way in there :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, if @cyanglaz is happy, let's merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! @ditman feel free to land it :)
All looks green, landing this now, will publish ASAP! Thanks for the contribution (and the patience) @pboos!! |
|
Now as we have to put in the path of our files I wonder how I can share a base64 encoded File that I get from the network? |
@ditman Thanks a lot for taking this on and getting it merged! 🚀 @lazylazyllama You could always temporarily store that file on the device within the app. The user won't even notice it. And as a note, before it was |
* master: [url_launcher, url_launcher_web]Added webOnlyWindowName parameter to launch() (flutter#2979) [battery_platform_interface] Introduce package. (flutter#2975) [url_launcher_platform_interface] Add webOnlyWindowName parameter to launch() (flutter#2974) [share] Add sharing file support (android & ios) (flutter#970) [integration_test] add support to get timeline (flutter#2947) [battery] Moved battery to its own subdir (flutter#2969) [integration_test] Fix channel name for iOS, docs (flutter#2972) [integration_test] Show stack trace of widget test errors on the platform side (flutter#2967) [video_player] Fix `setWithOthers` test (flutter#2970) [video_player_platform_interface] fix `setMixIWithOthers` test channel (flutter#2968) Add README instructions for enablePendingPurchases (flutter#2921) Rebase previous commits (flutter#2966) Avoid walleye 26 Updating documentation to use isEmpty check. (flutter#2955) [integration_test] Minor cleanup (flutter#2956) [path_provider, video_player] Tweak pubspecs to pass bulk analysis. (flutter#2959) [android_intent] fix platform package dep (flutter#2948) [shared_preferences_linux] update `file` package dep version to be compatible with framework (flutter#2950)
Co-authored-by: Kifah Meeran <23234883+MaskyS@users.noreply.github.com> Co-authored-by: Aloïs Deniel <alois.deniel@gmail.com> Co-authored-by: Colin Stewart <colin@owlfish.com>
Co-authored-by: Kifah Meeran <23234883+MaskyS@users.noreply.github.com> Co-authored-by: Aloïs Deniel <alois.deniel@gmail.com> Co-authored-by: Colin Stewart <colin@owlfish.com>
This pull request adds file sharing support to the share plugin.
To use while it is not yet published in the share plugin, just use the following in your
pubspec.yaml
: