Page 1 of 1

"mailto" not working in iOS

Posted: Mon Jun 27, 2016 10:39 am
by Maurice

Hi Appery Team,

I seem to have an issue with a button that I want to use that will open the native email app on an iOS device. I have already tested this with Android and all works as it should, but when testing it on iOS there is no action and the error:

canOpenURL: failed for URL: "mailto:a href="mailto:someone@somewhere.com" rel="nofollow"someone@somewhere.com/a" - error: "This app is not allowed to query for scheme mailto"

What I did so far was create a button, and then using the events created a click event and Javascript. Then used this script:

window.open("mailto:a href="mailto:someone@somewhere.com" rel="nofollow"someone@somewhere.com/a", '_system');

I seem to have gone round and round in circles trying to read and try different ideas and now require your expert assistance. I seems that when I read up on the latest iOS there needs to be a permission set to allow for apps to open elsewhere but I don't know what I am looking for here.

Regards

Image


"mailto" not working in iOS

Posted: Tue Jun 28, 2016 11:03 am
by Illya Stepanov

Hello -

I'm not sure if iOS platform accepts window.open object properties to use mailto: -- use link component for that.

:: https://devcenter.appery.io/documenta...

Image


"mailto" not working in iOS

Posted: Tue Jun 28, 2016 3:19 pm
by Maurice

Hi Illya
Thanks for getting back so quickly. This would work if I wanted to use a word or email address to link to, but I would like to use a button or is that not an option for iOS.
Regards


"mailto" not working in iOS

Posted: Wed Jun 29, 2016 4:23 pm
by Serhii Kulibaba

Hello Maurice,

You are able to set a style of that link the same as a button.


"mailto" not working in iOS

Posted: Wed Jun 29, 2016 7:16 pm
by Maurice

Hi Sergiy. I didn't even know I could do that on Appery. Could you point me somewhere so I can learn how to style the button?
Regards


"mailto" not working in iOS

Posted: Sun Jul 03, 2016 4:29 pm
by Maurice

Any thoughts Sergiy?


"mailto" not working in iOS

Posted: Sun Jul 03, 2016 8:25 pm
by Illya Stepanov

You can add any attributes and styles classes to your link element using jQuery, actually all elements in jQuery Mobile are links. You can learn more in documentation: https://api.jquerymobile.com/data-att...

I have tested this JS code:

prewindow.open("mailto:someone@somewhere", "_system");/pre

-- and this code works on the iOS devices (iOS 7.1.2 and 9.3.2) and opens the native mail app.


"mailto" not working in iOS

Posted: Thu Jul 07, 2016 9:47 am
by Maurice

Hi Illya,
Thank you for getting back to me regarding this. I have used this and it seems to work well. I added a bit more code so it would read from a storage item so I could link it to my database. All is working well.
Your help is much appreciate.
Cheers