Maurice
Posts: 0
Joined: Sun Mar 23, 2014 5:25 pm

"mailto" not working in iOS

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

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

"mailto" not working in iOS

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

Maurice
Posts: 0
Joined: Sun Mar 23, 2014 5:25 pm

"mailto" not working in iOS

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

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

"mailto" not working in iOS

Hello Maurice,

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

Maurice
Posts: 0
Joined: Sun Mar 23, 2014 5:25 pm

"mailto" not working in iOS

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

Maurice
Posts: 0
Joined: Sun Mar 23, 2014 5:25 pm

"mailto" not working in iOS

Any thoughts Sergiy?

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

"mailto" not working in iOS

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.

Maurice
Posts: 0
Joined: Sun Mar 23, 2014 5:25 pm

"mailto" not working in iOS

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

Return to “Issues”