includable / react-native-email-link

📭 Open an email client from React Native (for 'magic link' type functionality).

Home Page:https://includable.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Android targetSdkVersion 30: calling `openInbox` does nothing

rgommezz opened this issue · comments

Quoting new upcoming Android requirements:

Starting August 2021, new apps will be required to target API level 30 (Android 11) and use the Android App Bundle publishing format. Starting November 2021, all app updates will be required to target API level 30 (Android 11). Apps with a download size of more than 150 MB are now supported by Play Asset Delivery and Play Feature Delivery.

I just updated both compileSdkVersion and targetSdkVersion to 30 for my next update and the module stopped working. Basically when calling openInbox nothing happens and the promise resolves successfully with undefined

It works as expected when the target version is 29 or lower.

I've just started using this package and interested in getting this resolved. I was looking around at the changes in API 30. Could it relate to this change @rgommezz? It looks like the packages will need declaring in the same way as they do on iOS.

I am using this package as well and having the same issue

I'm not an android expert per se, so would be really happy if anyone else would be able to take a stab at this. If not, I'll try to find a solution early next week.

I was trying to reproduce this, but realised both of my test devices are still stuck on Android 10. You seem to be spot on though @benhowes, it's indeed new privacy functionality in Android 11.

I'm guessing this snippet needs to be added within your <manifest>...</manifest> in android/app/src/main/AndroidManifest.xml:

<queries>
   <intent>
      <action android:name="android.intent.action.VIEW" />
      <data android:scheme="mailto" />
   </intent>
</queries>

Would anyone be able to test this and verify if this solution works? Then we can get the README updated with this additional instruction.

does lib work with the expo? I'm having the same problem

It looks like Expo doesn't yet have a way of adding the code above, since you can't directly access the AndroidManifest.xml file in Expo apps. I don't think there's a way around that, other than ejecting. Hopefully Expo soon adds a way to configure this within app.json.

here https://github.com/flexible-agency/react-native-email-link/blob/master/docs/expo.md
he says to put this in the app.json to work, but here it didn't work

That's only for iOS, Expo doesn't have similar functionality to whitelist what apps you can open on Android yet...