Open iPhone App from an Email Link

怎甘沉沦 提交于 2019-12-18 13:25:02

问题


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!


回答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.




回答2:


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>



来源:https://stackoverflow.com/questions/11769874/open-iphone-app-from-an-email-link

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!