Expo linking issue trying to open the email app

Hi everyone!

I’m having a issue when I try to use Linking.openURL to open the mail app on iOS

My code:

...
import * as Linking from "expo-linking"
...

<Button 
onPress={() => Linking.openURL("mailto:support@support.com?subject=My subject&body=email body.")} >
</Button>

On iOS when pressing the button shows me: Error: Unable to open URL

BUT if I change the url to a text that does not have spaces, it works.
For example:

<Button 
onPress={() => Linking.openURL("mailto:support@support.com?subject=MySubject&body=emailBody.")} >
</Button>

I don’t have this issue on Android devices, only on iOS.

Note: I need the texts with spaces (subject and body)

Some help?

Expo-linking version: “~4.0.1”
SDK Version: 48
Platforms: Android and iOS

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