Skip to content

Commit

Permalink
Merge pull request #793 from cmgustavo/bug/error-sending-email-01
Browse files Browse the repository at this point in the history
Fix: error sending email on Android >= 13
  • Loading branch information
JohnathanWhite authored May 20, 2023
2 parents c163674 + 730156b commit 9e72dfd
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions patches/react-native-mail+6.1.1.patch
Original file line number Diff line number Diff line change
@@ -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<ResolveInfo> 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");
}
}
- }
+
}

0 comments on commit 9e72dfd

Please sign in to comment.