Skip to content

Commit

Permalink
fix(share): Avoid SecurityError on Android 10 file share (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile authored Oct 9, 2020
1 parent fd64cf9 commit b6a8191
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ public void share(PluginCall call) {
new File(Uri.parse(url).getPath())
);
intent.putExtra(Intent.EXTRA_STREAM, fileUrl);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
intent.setData(fileUrl);
}
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
}

if (title != null) {
Expand Down

0 comments on commit b6a8191

Please sign in to comment.