MailComposer.composeAsync({
recipients: [ user.email ],
subject: `Exporting ${ document.filename }`,
body: 'This is a file exported by app',
attachments: [
`${ FileSystem.cacheDirectory }${ document.filename }`,
],
})
the file exists (checked with FileSystem.getInfoAsync). I use the cacheDirectory instead of documentDirectory
as I found a discussion mentioning that MailComposer cannot access documentDirectory, but this does not solve my problem. As mentioned, the same piece of code works correctly on Android
This certainly seems like it has the makings of a bug. Do you think you could create a github issue for this here: Issues · expo/expo · GitHub that has a way to reproduce the error either via github repo or more ideally a Snack?
Hello @adamjnav
Sadly MailComposer is explicitly disabled on Snack. In the meantime, I have narrowed down the origin of the problem: the red screen happens when trying to attach using an uri which filename has no extension. Adding any extension when naming the file makes the mailer opens correctly.