Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error : not_available in Android 13 with only GMail App #196

Open
yusufsham opened this issue Feb 6, 2023 · 9 comments
Open

Error : not_available in Android 13 with only GMail App #196

yusufsham opened this issue Feb 6, 2023 · 9 comments

Comments

@yusufsham
Copy link

yusufsham commented Feb 6, 2023

The Mailer function is unable to detect GMail as a mailing App on the phone with Android 13 when its the only mailing App present.

Case 1: Only GMail as a mailing App present. Signed-in already. It returns the above error. Unable to find the GMail App as an option to send the mail through.
Case 2: = 2 mailing Apps present. It opens the another App by default without showing GMail as an option to select.
Case 3: > 2 Mailing Apps present. It shows option to select all mailing Apps with GMail also. Here GMail option works as intended, with To, Subject, Body and Attachment all present.

Note: 1. Outlook App opens with Compose Mail, but the body text doesn't load. Other details gets filled up as intended.
2. RediffMail App opens on Inbox open. Doesn't go to Compose Mail section.

@G10dRafaFan
Copy link

Facing Same Issue...@yusufsham are you able to get solution for it.

@yusufsham
Copy link
Author

yusufsham commented Mar 6, 2023

I have found a work around. As the latest package is unable to find the GMail app if its the only existing mailing App, I have modified the library a bit. Please find the Solution below:
Replace the following file in the node_modules > react-native-mail > android > src > main > java > com > chirag > RNMail > RNMailModule.java

Then use patch-package library to patch the code and include it in the build.
https://github.com/ds300/patch-package#readme

Note: Make sure you catch the error, thrown by the package, where you actually use Mailer function in your code.

package com.chirag.RNMail;.txt

Update: The above patch is not working with the latest Android Security Patch March 2023. I am looking into it. Meanwhile any help would be highly appreciated.

@G10dRafaFan
Copy link

@yusufsham Thanks for giving work around

@mainseq
Copy link

mainseq commented Mar 29, 2023

Are there any plans for a PR?

@yusufsham
Copy link
Author

Are there any plans for a PR?

This is not a proper fix, but a workaround. Let the maintainers do it in a cleaner way. Or else I'll get it done that way and then generate a PR, (When I get time!! ;p)

@mainseq
Copy link

mainseq commented Mar 30, 2023

I think the fix is in this post. We just need to set a proper flag I believe.

https://stackoverflow.com/questions/73666471/how-to-solve-queryintentactivities-deprecated-in-api-33/73920935

Or maybe we don't need it at all since the chooser has a "use always" option...

@joshua-revolutions
Copy link

I have found a work around. As the latest package is unable to find the GMail app if its the only existing mailing App, I have modified the library a bit. Please find the Solution below: Replace the following file in the node_modules > react-native-mail > android > src > main > java > com > chirag > RNMail > RNMailModule.java

Then use patch-package library to patch the code and include it in the build. https://github.com/ds300/patch-package#readme

Note: Make sure you catch the error, thrown by the package, where you actually use Mailer function in your code.

package com.chirag.RNMail;.txt

@yusufsham Can you explain your work around? What code did you change?

@G10dRafaFan

This comment was marked as resolved.

@yusufsham
Copy link
Author

yusufsham commented Jun 6, 2023

@chirag04 Please find the PR for Android 13 compatibility tested up to March 23 security Update. I have used a filter technique for filtering out Mailing Apps from the resolved list. Please clean it to be more efficient, if you could.
#197

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants