I am working on a React Native application running react-native 072.5. The current task is to build a feature to share an invite link, and I'm encountering a problem on iOS when sharing the link via Apple's email app.
The link is generated with Firebase Dynamic Links, we retrieve it successfully from the backend, and I have confirmed it works properly (for example, sharing via sms or copy/paste).
For our feature, we use React Native Linking to open a new email in the user's email app. We share the link as part of the email body, and it looks like Apple Mail shortens it. When I send the link and click on it, it opens a browser window and shows the invited user an error message saying it is an invalid Firebase Dynamic Link. Using the same code, however, I am able to share the link successfully via Gmail (both on iOS and Android). And like I said, it works via copy/paste and SMS.
Here is the code I'm using to open the email
Linking.openUrl(
`mailto:?body=${sharedLink}&subject=${t('lorem_ipsum_title')}`
);
Here are the things I've tried: -Wrapped the link in encodeURIComponent -Also tried wrapping the entire body in encodeURIComponent -Used a different email library to open the user's email app (react-native-email-link) -Wrapped the link in the encode method from the html-entities library (I don't know why I thought this would work, but I was running out of ideas) -Checked the syntax of the mailto several times
The expectation is that a user should be able to send an invite link via Apple's email app and the invited user should be directed to the AppStore if the app is not already installed, or it should open the app if already installed.
Please offer any suggestions. Thank you.