From 730156bd963076d9003883e216ad5d8435f9fc7d Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Thu, 4 May 2023 16:36:18 -0300 Subject: [PATCH] Fix: error sending email on Android >= 13 --- patches/react-native-mail+6.1.1.patch | 31 +++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 patches/react-native-mail+6.1.1.patch diff --git a/patches/react-native-mail+6.1.1.patch b/patches/react-native-mail+6.1.1.patch new file mode 100644 index 000000000..8c0257efe --- /dev/null +++ b/patches/react-native-mail+6.1.1.patch @@ -0,0 +1,31 @@ +diff --git a/node_modules/react-native-mail/android/src/main/java/com/chirag/RNMail/RNMailModule.java b/node_modules/react-native-mail/android/src/main/java/com/chirag/RNMail/RNMailModule.java +index e93973e..d59f4c2 100644 +--- a/node_modules/react-native-mail/android/src/main/java/com/chirag/RNMail/RNMailModule.java ++++ b/node_modules/react-native-mail/android/src/main/java/com/chirag/RNMail/RNMailModule.java +@@ -127,19 +127,7 @@ public class RNMailModule extends ReactContextBaseJavaModule { + PackageManager manager = reactContext.getPackageManager(); + List list = manager.queryIntentActivities(i, 0); + +- if (list == null || list.size() == 0) { +- callback.invoke("not_available"); +- return; +- } + +- if (list.size() == 1) { +- i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); +- try { +- reactContext.startActivity(i); +- } catch (Exception ex) { +- callback.invoke("error"); +- } +- } else { + String chooserTitle = "Send Mail"; + + if (options.hasKey("customChooserTitle") && !options.isNull("customChooserTitle")) { +@@ -155,5 +143,5 @@ public class RNMailModule extends ReactContextBaseJavaModule { + callback.invoke("error"); + } + } +- } ++ + }