Coder
Coder

Reputation: 1681

UIWebView email hyperlink is not working on device

I am displaying a HTML page in my iPhone app. The HTML page has few Email addresses. In Mac desktop browser, if the same HTML page is opened and if i click on email address, MAC machines mailbox is opened to compose a new email. Whereas in iPhone, on clicking the email address it is trying to load the webView thinking it as a link.

How come it is working on MAC browser and not in iPhone app.

Source in HTML is :

<a href="mailto:[email protected]">[email protected]</a>

If i try to handle using MFMailControlViewController, it works. But my real question is, how come MAC desktop launching mail box and iPhone doesn't.

Thanks Jithen

Upvotes: 1

Views: 906

Answers (1)

Vojtech Vrbka
Vojtech Vrbka

Reputation: 5368

Go to interface builder to Web View settings. You need to enable Addresses and Links detection.

Setting webView in interface builder

or

in the code:

webView.dataDetectorTypes = UIDataDetectorTypeAll;

Upvotes: 4

Related Questions