File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
android/src/main/java/com/chirag/RNMail Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ private String[] readableArrayToStringArray(ReadableArray r) {
55
55
@ ReactMethod
56
56
public void mail (ReadableMap options , Callback callback ) {
57
57
Intent i = new Intent (Intent .ACTION_SEND_MULTIPLE );
58
- i .setType ("text/plain " );
58
+ i .setType ("vnd.android.cursor.dir/email " );
59
59
60
60
if (options .hasKey ("subject" ) && !options .isNull ("subject" )) {
61
61
i .putExtra (Intent .EXTRA_SUBJECT , options .getString ("subject" ));
@@ -116,7 +116,13 @@ public void mail(ReadableMap options, Callback callback) {
116
116
callback .invoke ("error" );
117
117
}
118
118
} else {
119
- Intent chooser = Intent .createChooser (i , "Send Mail" );
119
+ String chooserLabel ;
120
+ if (options .hasKey ("chooserLabel" ) && !options .isNull ("chooserLabel" )) {
121
+ chooserLabel = options .getString ("chooserLabel" );
122
+ } else {
123
+ chooserLabel = "Send Mail" ;
124
+ }
125
+ Intent chooser = Intent .createChooser (i , chooserLabel );
120
126
chooser .setFlags (Intent .FLAG_ACTIVITY_NEW_TASK );
121
127
122
128
try {
You can’t perform that action at this time.
0 commit comments