简体   繁体   English

Facebook iOS应用程序未启动我的应用程序启用Applinks链接

[英]Facebook iOS app not launching my app for Applinks enabled link

I have added the following meta info in the head portion of my test web page. 我在测试网页的头部添加了以下元信息。

<html>
<head>
  <meta property="al:ios:url" content="schemeregisteredinapp://hereGoesTheURL" />
  <meta property="al:ios:app_store_id" content="12345" />
  <meta property="al:ios:app_name" content="Applinks Supporting App" />
</head>

<body>
<p>Opening a link to this page in Facebook iOS app should launch my "Applinks Supporting App".
</p>
</body>
</html>

I have added the custom url scheme schemeRegisteredInApp in my iOS app's info.plist. 我在我的iOS应用程序的info.plist中添加了自定义URL方案schemeRegisteredInApp If I type a url of the format schemeRegisteredInApp://the/rest/of/the/path in iOS Safari browser, it successful launches my app. 如果我在iOS Safari浏览器中输入格式为schemeRegisteredInApp://the/rest/of/the/path的url,它会成功启动我的应用程序。

But if I tap on a link to the webpage containing above mentioned HTML in Facebook app or Mailbox app (both are supposed to support applinks protocol) on iOS, the page just opens in a web view inside the Facebook app. 但是,如果我在iOS应用程序上点击Facebook应用程序或邮箱应用程序(两者都应该支持applinks协议)的包含上述HTML的网页的链接,该页面只会在Facebook应用程序内的Web视图中打开。 My iOS app is never launched. 我的iOS应用程序从未启动过。 I can't figure out what is going wrong. 我无法弄清楚出了什么问题。 Applinks simply refuses to work as advertised. Applinks拒绝像宣传的那样工作。 This is on iOS 8. Is Applinks broken? 这是在iOS 8. Applinks坏了吗?

Add the following to your website meta data and the Facebook iOS app will open your app directly. 将以下内容添加到您的网站元数据,Facebook iOS应用程序将直接打开您的应用程序。

<meta property="al:web:should_fallback" content="false" />

If that doesn't work then you still have other issues with your meta data. 如果这不起作用,那么您的元数据仍然存在其他问题。 Best way to debug is to go to developers.facebook.com/tools/debug/og/object and type in your url and select 'Show existing scrape information'. 调试的最佳方法是访问developers.facebook.com/tools/debug/og/object并输入您的网址并选择“显示现有的刮取信息”。 If there are any errors it won't work. 如果有任何错误,它将无法正常工作。 Fix the problems and hit the 'Fetch new scrape information' button. 解决问题并点击“获取新的刮擦信息”按钮。 Then kill the Facebook iOS app and relaunch it. 然后杀死Facebook iOS应用程序并重新启动它。 Then the AppLink will work as expected next time you press the item in the FB feed. 然后,当您按下FB Feed中的项目时,AppLink将按预期工作。

I tested on iOS 7. Before I updated to the latest Facebook app, I can see a popup at the bottom of the Facebook browser which leads me to my own app. 我在iOS 7上测试过。在我更新到最新的Facebook应用程序之前,我可以看到Facebook浏览器底部的弹出窗口,它引导我到我自己的应用程序。 Right after I updated the Facebook app to latest version, the popup doesn't show anymore. 在我将Facebook应用更新到最新版本之后,弹出窗口不再显示。 Same doesn't work on iOS 8. Maybe a bug in newest Facebook version. 同样不适用于iOS 8.也许是最新Facebook版本中的错误。 Hope to see they fix it or find a workaround. 希望看到他们修复它或找到解决方法。

I just checked the example you provided. 我刚检查了你提供的例子。 For me it correctly shows a popup to install your app, but when installed it doesn't recognise it as being installed. 对我来说,它正确显示了一个安装你的应用程序的弹出窗口,但是在安装时它不会将其识别为已安装。

I inspected your app's plist and it seems that you haven't registered the URLSchema there. 我检查了你的应用程序的plist,似乎你没有在那里注册URLSchema。 That is needed for Applinks to check if the app is installed or not. 这是Applinks检查应用程序是否已安装所必需的。

Can you test this with a project where you have defined the Appschema in your app's plist? 您可以使用您在应用程序的plist中定义Appschema的项目来测试这个吗?

If you want that link works in optional way when it launches app or open web page if app is not installed you need to add following meta-tag: 如果您希望该链接在启动应用程序时以可选方式工作,或者如果未安装应用程序则打开网页,则需要添加以下元标记:

<pre>
<meta property="fb:app_id" content="[facebook app id]" />
</pre>

It does matter whether facebook app id exists or not. facebook app id是否存在无关紧要。 It will work properly in iOS only if it is exists. 只有在iOS存在的情况下,它才能在iOS中正常运行。 However Facebook on Android will open web view first still but allow to launch app from this page. 但Android上的Facebook将首先打开Web视图,但允许从此页面启动应用程序。

Following meta tag must be removed: 必须删除以下元标记:

<pre>
<meta property="al:web:should_fallback" content="..." />
</pre>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM