Linking to mailto

#1

I am having an issue using the mailto link, when I use the following:

Linking.openURL(‘mailto:support@test.com’);

I get “Attempt to invoke virtual method ‘boolean java.lang.String.endsWith(java.lang.String)’ on a null object reference” error.
However when I use Linking.openURL(‘mailto://support@test.com’) I am able to open the email client, but the address it sends to is always ‘//support@test.com’ with the slashes included.
I don’t understand what I’m doing wrong, and was told I should come here for help.

I am testing on a Samsung Galaxy s8+ and I don’t know if this is Android specific. In an iPhone sim I just get a promise rejection, which makes sense because it doesn’t have the email app.

Thanks!

1 Like
#2

Same problem here

#3

Same problem here, even with libraries such as react-native-communications it seems not to work.

#4

I think you’re running into https://github.com/expo/expo/issues/1711
We have a fix in flight which should hopefully be available to you sometime next week

#5

Are there any news about this? A workaround at least?

#6

Hi @tiago_provenzano - as noted in the GH issue, the fix is out now. You will need to either update the Expo client app on your phone, rebuild your standalone app, or follow the normal upgrade instructions for ExpoKit to get the fix.

Let us know if you continue to have trouble.

1 Like
closed #7

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.