8

I've working on a program where an email is sent to a user, and a link to open the iPhone app is embedded in the email. The problem is that when the user clicks the link to open the app, mail has stripped out the colon, so the link no longer works!

The link being created basically looks like this:

@"<BR><BR><BR><A HREF=\"http://myApp://\">Open App</A>"

But the link, when clicked in the email, opens this in the browser instead:

myApp//

with no colon, so the app doesn't launch and the browser says it can't find the page.

Any ideas how to fix this? Thanks!

nbrooks
  • 18,126
  • 5
  • 54
  • 66
P.M.
  • 436
  • 6
  • 12
  • Please google "iOS Apps custom URL Scheme" – Jessedc Aug 02 '12 at 02:27
  • I am not sure you need the "http://" portion of it... – TommyG Aug 02 '12 at 03:37
  • I've seen those tutorials and they are very helpful for setting up an app to accept URLs to launch, but they don't say anything about placing the custom URL in emails and preserving the URL in the email. Unfortunately, if you leave off the http:// then the link is no longer a link in the email. :/ – P.M. Aug 02 '12 at 23:06
  • 1
    Actually it turns out leaving off the http:// works if you open the email in Apple's mail app, but gmail disables the link without the http:// probably as some sort of security measure. Any thoughts anyone? – P.M. Aug 02 '12 at 23:18

2 Answers2

1

It just should be:

@"<BR><BR><BR><A HREF=\"myApp://\">Open App</A>"

As a workaround for custom urls being blocked by gmail, what you could do is set up something like http://myapp.mydomain.com/ up do redirect to myapp://... That way it'll look like a normal domain but open your app. On the plus you will be able to see how many people click your link, though on the down side it'll pop via Safari first.

hypercrypt
  • 15,389
  • 6
  • 48
  • 59
0

Add 'http:' to all your images and urls, iphones dont recognize links w/o that. also use single quotes for them(').eg. <a href='http://xyz.com'></a><img src='http://xyz.com/pqr/abc.jpg'></img>

Teena Thomas
  • 5,139
  • 1
  • 13
  • 17