Closed karel-suchomel-ed closed 7 months ago
the same
react-native version: 0.71.1
Anyone find a work around?
Same here! 0.71.3 But it doesn't work even without the subject. On non-default client works fine.
It looks like iOS might now to require adding the mailto scheme to LSApplicationQueriesSchemes. Adding it in your Info.plist should help.
It looks like iOS might now to require adding the mailto scheme to LSApplicationQueriesSchemes. Adding it in your Info.plist should help.
Thanks for the reply, in Expo we need to do something in the configuration of the plugin?
Edit:
I've added this via Expo config
{
"expo": {
"ios": {
"infoPlist": {
"LSApplicationQueriesSchemes": ["mailto"]
}
}
}
}
but still not working
@tschoffelen I had mailto in my plist but still have the same issue. I also added file as per the error message but that didn't fix.
Appears to be something with the subject/body. If I only populate the 'to' it works. If I add a subject or body it fails.
Any update about this? I've installed the latest release of this lib but nothing has changed.
@tschoffelen I had mailto in my plist but still have the same issue. I also added file as per the error message but that didn't fix.
Appears to be something with the subject/body. If I only populate the 'to' it works. If I add a subject or body it fails.
I have the same problem even without the plugin, if I add a subject or body with Linking API the result is the same. 🤔
@karel-suchomel-ed @giacomoalonzi @martinblampied I've made small investigation. Incorrect encoding is the root of this issue. So you can simply encode your subject and body using encodeURIComponent() if your platform is iOS.
openComposer({ to: Emails.SUPPORT_EMAIL, subject: Platform.OS === 'ios' ? encodeURIComponent(yourSubject) : yourSubject, body: Platform.OS === 'ios' ? encodeURIComponent(yourBody) : yourBody, });
Or you can use 'encodeBody: true' if you have problems with body
@AndreiBehel - sorry for late reply. That worked thanks 👍
@karel-suchomel-ed @giacomoalonzi @martinblampied I've made small investigation. Incorrect encoding is the root of this issue. So you can simply encode your subject and body using encodeURIComponent() if your platform is iOS.
openComposer({ to: Emails.SUPPORT_EMAIL, subject: Platform.OS === 'ios' ? encodeURIComponent(yourSubject) : yourSubject, body: Platform.OS === 'ios' ? encodeURIComponent(yourBody) : yourBody, });
Or you can use 'encodeBody: true' if you have problems with body
I had the same problem, and this also solved my issue. Thanks @AndreiBehel !
Should we build this into the library? I'm happy to accept a PR for this change
Should we build this into the library? I'm happy to accept a PR for this change.
Hi, @tschoffelen I opened a PR ( https://github.com/includable/react-native-email-link/pull/125 ) which adds support to encode the subject.
I hope you guys can review it :)
This issue is stale because it has been open for 60 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale. Please feel free to re-open if you feel this issue is still relevant.
As the title says I'm trying to compose an email using this library with subject and body, but when selecting the Default mail reader it throws an error:
[Error: Unable to open URL: file:///private/var/containers/Bundle/Application/23727D6B-B7ED-4C2F-BE2E-85F06F2F9D77/Example.app/mailto:...%3Fsubject=Mobile%20application%20customer%20support. Add file to LSApplicationQueriesSchemes in your Info.plist.]
When I select for example Gmail, it works correctly
If I remove the subject, it works even with the Default mail reader
This is how I'm calling the method
I tried using the default Linking API with mailto:email@email.com?cc=$subject=${subject}&body=${body}and it is resulting in the same error