Skip to content

Commit 5a28255

Browse files
authored
Workaround for Android Multiple Attachments bug (#158)
this workaround allows to send one attachment in the current v5.
1 parent 3f92682 commit 5a28255

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

android/src/main/java/com/chirag/RNMail/RNMailModule.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,12 @@ public void mail(ReadableMap options, Callback callback) {
9898
uris.add(u);
9999
}
100100
}
101-
i.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);
101+
102+
if (uris.size() == 1) {
103+
i.putExtra(Intent.EXTRA_STREAM, uris.get(0));
104+
} else {
105+
i.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);
106+
}
102107
}
103108

104109
PackageManager manager = reactContext.getPackageManager();

0 commit comments

Comments
 (0)