I’ve recently updated my iOS app from phonegap to voltbuilder, and the send email functionality has stopped working.
I have been using location.href=“mailto:” + encodeURI(t) + “?subject=” + encodeURI(subject) + “&body=” + encodeURI(body). successfully for years, but it doesn’t bring up email when running on iOS and I don’t know why. It still works on the desktop, just not when built for iOS
I have also tried the sample email code using but that doesn’t do anything either.
Any ideas? Is there some setting or configuration that maybe blocking it?
Have you tried Remote Debugging to see if there are any messages?
I have been testing using BrowserStack, but I find it difficult to isolate the huge amount of messages in the debug console. But I haven’t seen any error messages around the function from what I can tell. I will try to look more carefully, but it’s almost as if it’s ignoring the code, although it does function when running in the desktop browser
My hunch is that it is a permissions issue/whitelist - both iOS and Android have been upping the security on these calls. The best way to figure out what is needed to to look at the Console output.
It is definitely something to do with permissions, but I cannot figure out how to overcome it. It seems like a more recent iOS issue.
I’ve gone with a different solution instead now, at least for the voltbuilder version. I’m using cordova-plugin-email-composer plug in to bring up the send email dialog. That seems to be working well on iOS and has solved my issue. Although for desktop testing I still have the “location.href” code