Skip to content

Commit

Permalink
Workaround for Android Multiple Attachments bug (#158)
Browse files Browse the repository at this point in the history
this workaround allows to send one attachment in the current v5.
  • Loading branch information
Relax594 authored Aug 25, 2020
1 parent 3f92682 commit 5a28255
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion android/src/main/java/com/chirag/RNMail/RNMailModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,12 @@ public void mail(ReadableMap options, Callback callback) {
uris.add(u);
}
}
i.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);

if (uris.size() == 1) {
i.putExtra(Intent.EXTRA_STREAM, uris.get(0));
} else {
i.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);
}
}

PackageManager manager = reactContext.getPackageManager();
Expand Down

0 comments on commit 5a28255

Please sign in to comment.