We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1382c9f commit 1c47e15Copy full SHA for 1c47e15
android/capacitor/src/main/java/com/getcapacitor/plugin/Share.java
@@ -2,6 +2,7 @@
2
3
import android.content.Intent;
4
import android.net.Uri;
5
+import android.os.Build;
6
import android.webkit.MimeTypeMap;
7
8
import androidx.core.content.FileProvider;
@@ -50,6 +51,10 @@ public void share(PluginCall call) {
50
51
intent.setType(type);
52
Uri fileUrl = FileProvider.getUriForFile(getActivity(), getContext().getPackageName() + ".fileprovider", new File(Uri.parse(url).getPath()));
53
intent.putExtra(Intent.EXTRA_STREAM, fileUrl);
54
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
55
+ intent.setData(fileUrl);
56
+ }
57
+ intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
58
}
59
60
if (title != null) {
0 commit comments