nOOb iOS
nOOb iOS

Reputation: 1394

iPhone: URL scheme not working from mail client

I have created URL schemes in my app. I just wanted to open my app from an email. I copy the custom URL scheme myapp:// in browser and it is opening my app. But when I try opening it from email in iOS mail client, it doesn't open. Is there anything extra needed to be done to open my app from email?

Upvotes: 6

Views: 1970

Answers (2)

CuriousGeorge
CuriousGeorge

Reputation: 7400

Unfortunately, some email clients just don't handle custom URLs properly.

One solution is to get the browser to open the link instead of the email client. Just host a web-page with a redirect somewhere, and redirect to your custom link.

For example, a php page:

<?php
    $arg = $_GET["arg"];
    $url = "myapp://host?arg={$arg}";
    header("Location: {$url}");
?>

Then put a normal link in the email:

http://www.example.com/openurl.php?arg=123

Upvotes: 1

Mrunal
Mrunal

Reputation: 14118

In e-mail body, you should write content in html format. Here you require a hyperlink so there should be <a href> ... </a>

For example:

<a href="myapp://">Launch MyApp</a>

Hope this helps.

Upvotes: 0

Related Questions