This repository was archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[share] Add sharing file support (android & ios) #970
Merged
Merged
Changes from all commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
6933930
[share] Update example to use v2 plugins
pboos f84efb5
[share] add file share support
pboos 7d9eb8a
[share] Fix: When sharing file, as well share the text
pboos e0def31
[share] Fix: async requirements
pboos 9abd37e
[share] Fix formatting & async
pboos 697c89b
[share] Fix more formatting
pboos 66766d0
[share] Fix problems with nextMajor check by removing version from ex…
pboos 589c83e
[share] Update documentation formatting
pboos a82ee3d
[share] example: Revert to using v1 of the plugin
pboos e3685a2
[share] Update example on shareFile to not share text and file (which…
pboos 696453f
[share] Update example with image_picker
pboos 9065310
[share] Add support to share multiple files
pboos 333bad7
[share] Update tests
pboos c7739d7
[share] Fix formatting
pboos 8c9f55f
Fix Permission Denial error
MaskyS 0fb2f9a
Merge pull request #1 from MaskyS/patch-1
pboos 2b27e0c
Fix formatting
pboos e2cdec1
[share] Allowing shared images on iOS to have specific actions (save …
aloisdeniel 4ecd3c3
Resolving conflict with open_file
cms103 9c1518a
Added missing namespace.
cms103 bab3a2b
More attempts to fix Manifest
cms103 57777e9
Created custom provider to avoid name conflicts.
cms103 52e8b30
Updated to use the custom provider.
cms103 64c77cd
Remove unneeded edits.
cms103 3ad3351
Updated as per the contribution guidelines.
cms103 4e8a17e
Merge pull request #2 from aloisdeniel/feature/shareFile
pboos d886085
Merge pull request #3 from cms103/feature/shareFile
pboos 2804c23
Merge branch 'master' into feature/shareFile
pboos 86e746d
[share] Update dependencies
pboos fd23afd
[share] Fix formatting
pboos 9494310
[share] Update deprecated code in example
pboos 1b05256
[share] Fix uninitialized variable
pboos 2a9da4b
[share] use mime package for mime type lookup
pboos 4567fdb
[share] Return `application/octet-stream` in case mime returns `null`
pboos b8fb036
[share] Remove library dependency on `dart:io` to allow future suppor…
pboos bebd768
Merge branch 'master' into feature/shareFile
pboos e92ecc3
[share] Update version to 0.6.5
pboos 16c9b25
[share] Formatting
pboos a426f93
[share] [BUILD]
pboos c4de8e8
Merge branch 'master' into feature/shareFile
pboos 28b6de5
[share] Remove `shareFile()` as it does not more than `shareFiles()`
pboos 271cf5e
[share] example: wrap within SingleChildScrollView
pboos dd414d8
[share] example: Extract methods and widgets
pboos 4b3b6f8
[share] Formatting
pboos b77cc0f
[share] Formatting
pboos 14b9338
[share] Update tests
pboos 88e5723
[share] example: Add public member api docs
pboos 9f1f775
[share] android: handle empty fileUris list
pboos d93dec4
[share] android: Handle activity == null
pboos 2403c5a
[share] android: do `grantUriPermission` for each file
pboos 6592125
[share] android: Fix wrongly callled method (part of activity == null…
pboos 33b1aa1
[share] Various small improvements from PR review
pboos 6bc2f6b
[share] android: Improve calls where activity could be null to use co…
pboos f00cf55
[share] example: allow sharing of only images
pboos 7ea12d6
[share] ios: correct error message
pboos 12aee1f
[share] android: formatting
pboos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,7 @@ | ||
| ## 0.6.5 | ||
|
|
||
| * Added support for sharing files | ||
|
|
||
| ## 0.6.4+5 | ||
|
|
||
| * Update package:e2e -> package:integration_test | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,14 @@ | ||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
| package="io.flutter.plugins.share"> | ||
| <application> | ||
| <provider | ||
| android:name="io.flutter.plugins.share.ShareFileProvider" | ||
| android:authorities="${applicationId}.flutter.share_provider" | ||
| android:exported="false" | ||
| android:grantUriPermissions="true"> | ||
| <meta-data | ||
| android:name="android.support.FILE_PROVIDER_PATHS" | ||
| android:resource="@xml/flutter_share_file_paths"/> | ||
| </provider> | ||
| </application> | ||
| </manifest> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
packages/share/android/src/main/java/io/flutter/plugins/share/ShareFileProvider.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| // Copyright 2019 The Flutter Authors. All rights reserved. | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| package io.flutter.plugins.share; | ||
|
|
||
| import androidx.core.content.FileProvider; | ||
|
|
||
| /** | ||
| * Providing a custom {@code FileProvider} prevents manifest {@code <provider>} name collisions. | ||
| * | ||
| * <p>See https://developer.android.com/guide/topics/manifest/provider-element.html for details. | ||
| */ | ||
| public class ShareFileProvider extends FileProvider {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
packages/share/android/src/main/res/xml/flutter_share_file_paths.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <paths> | ||
| <external-path name="external" path="."/> | ||
| <external-files-path name="external_files" path="."/> | ||
| <external-cache-path name="external_cache" path="."/> | ||
| </paths> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
I was wondering if merge rule markers can be of use here instead of introducing another provider 🤔
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.
Good point. This was as well what I hated most in this plugin. But wonder what other provider to merge it with and if meta-data could make problems if merged with another. Specially if the other package as well uses FILE_PROVIDER_PATHS with a different config. Basically I know too little about how to handle this here. If anyone has more knowledge and can tell me how (or even create a PR on to update my feature branch) that would be great :)