问题描述
我一直在试用iPhone SDK中的URL方案,我已经让我的应用程序使用自定义URL方案启动,如myap:// Dosomething,但这对我想要的并不实用。有可能以某种方式注册一个方案,允许电子邮件中的链接,如启动我的应用程序,如app store链接和youtube链接吗?
I've been trying out the URL schemes in the iPhone SDK and I have got my application to launch using a custom URL scheme like "myap://Dosomething" but that is not really practical for what I want. Is it possible to register a scheme somehow that would allow links in emails like "http://www.mydomain.com/" to launch my application, like app store links and youtube links do?
推荐答案
如果你想要链接是可以在邮件中点击,你必须使用 http://
链接来启动Safari。这意味着您应该在某个Web服务器上创建一个页面,该页面使用您的 myApp://
url返回HTTP 303重定向(请参阅其他)。这应该会导致Safari启动您的应用程序。如果失败,您可以尝试< meta>
重定向,作为最后的手段,标准< a href =myApp:// >点击我< / a>
链接。
If you want the link to be clickable in Mail you have to use an http://
link which will launch Safari. This means you should create a page on a webserver somewhere that return an HTTP 303 redirect (See Other) with your myApp://
url. This should cause Safari to launch your application. If that fails you can try a <meta>
redirect, and as a last resort a standard <a href="myApp://">Click me</a>
link.
这篇关于从电子邮件链接启动iPhone应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!