【问题标题】:App link page with meta tags not working带有元标记的应用链接页面不起作用
【发布时间】:2016-03-08 11:32:34
【问题描述】:

我已经设置了一个带有应用链接元标记的网页,以重定向到我的应用或网站。如果我直接在 iphone 上的浏览​​器中键入 url 方案(在浏览器中键入 myapp:// 启动应用程序),则 url 方案有效。然后我设置了以下网页:

<html>
    <head>
    <meta property="al:ios:url" content="myapp://" />
    <meta property="al:iphone:url" content="myapp://" />
    <meta property="al:ios:app_name" content="My App" />
    <meta property="al:web:url" content="http://myapp.com" />
    </head>
    <body>
    Hello, world!
    </body>
</html> 

网站只是加载页面,并没有启动应用程序或重定向到主页。

【问题讨论】:

    标签: ios applinks


    【解决方案1】:

    那些&lt;meta&gt; 标签仅供 Facebook 爬虫使用。像 Safari 这样的移动浏览器完全忽略了它们。你需要像这样使用 JavaScript:

    setTimeout(function() {
      window.location = "https://itunes.apple.com/path/to/your/app/";
    }, 25);
    
    // If "yourapp://" is registered, your app will launch immediately and the
    // timer won't fire. If not, you'll get an ugly "Cannot Open Page"
    // dialogue and then the App Store will launch
    
    window.location = "yourapp://";
    

    显然这不是一个理想的解决方案,而且它有很多令人讨厌的边缘情况。正如my answer to your other question 中提到的,您会更喜欢Branch.io 这样的服务

    【讨论】:

    • 谢谢,是的,我终于理解了应用链接。 Branch.io 看起来不错,只是还不能编译
    • 如果有什么我可以帮忙的,请告诉我。分支也有awesome support!
    • 感谢大家现在工作得很好。最终使用 branch.io 更容易
    猜你喜欢
    • 1970-01-01
    • 2015-05-28
    • 1970-01-01
    • 1970-01-01
    • 2013-08-14
    • 2012-09-17
    • 1970-01-01
    • 2016-02-25
    • 2013-11-08
    相关资源
    最近更新 更多