带有Facebook的Android Deeplink无法正常工作-重定向到Play商店而不是启动应用程序 [英] Android Deeplink with facebook not working - redirecting to play store instead of launching application

查看:353
本文介绍了带有Facebook的Android Deeplink无法正常工作-重定向到Play商店而不是启动应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将我的应用程序与Facebook深层链接。
我的应用程序 Url https:www.xyz.com/app

I am trying to deep link my application with facebook. My App Url is https:www.xyz.com/app

以下是我的意图过滤器:

<intent-filter android:label="@string/app_name">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="https"
android:host="www.xyz.com"/>
</intent-filter>

我正在Facebook中发布链接,当有人单击链接时,该链接将重定向到Google Play商店,要求用户打开应用程序(如果已安装),而不是加载存在意图过滤器的类。

I am posting a link in facebook, when someone click on the link, the link is getting redirected to Google play Store and asks the user to open the application if installed, instead of loading the class in which the intent filter is present.

活动名称已在Facebook开发者帐户中指定。

Activity name has been specified in facebook developer account.

请让我知道我在做什么错误。

Please let me know what mistake am I doing.

推荐答案

手动解决方案



您需要配置网站以处理 Facebook的应用程序链接(与Android应用程序链接不同)。为此,您需要将Facebook应用程序链接元标记添加到关联的网页。尽管我认为应用程序链接应该很好,但您也应该将应用程序配置为处理URI方案。

Manual Solution

You need to configure your website to handle Facebook's App Links (different from Android App Links). In order to do this you need to add the Facebook app link meta tags to the associated web page. You should also configure your app to handle URI schemes as well, although I think App Links should be fine.

<head>
...
     <meta property="al:android:url" content="sharesample://story/1234">
     <meta property="al:android:package" content="com.facebook.samples.sharesample">
     <meta property="al:android:app_name" content="ShareSample">
     <meta property="og:title" content="example page title" />
     <meta property="og:type" content="website" />
     ...
</head>

您将需要在与网站内容相关的每个网页上显示这些标签。然后,您可以使用以下curl命令来检查以确认Facebook应用程序已正确抓取您的元标记:

You will need to have these tags present on every one of your web pages that is associated with web content. You can then check to verify that your meta tags are being properly scraped by the Facebook app with using this curl command:

curl -a facebookexternalhit https:www.xyz.com/app

将所有这些配置完毕后,Facebook应该正确地将深层链接退出您的应用程序。

Will all of this configured, Facebook should properly deep link out of your app.

分支具有已在链接中配置的解决方案。当使用关联的 $ fallback_url 创建分支链接,并且您的应用已通过FB身份验证(您可以在文档中找到如何执行此操作)时,分支将插入正确的元标签给你。我强烈建议您使用此SDK,因为它将在您将来的深层链接工作中为您节省很多痛苦和心痛。

Branch has a solution already configured in the links. When a Branch link is created with an associated $fallback_url and your app is authenticated with FB (you can find how to do this in the docs), Branch will insert the correct meta tags for you. I highly recommend using this SDK as it will save you a lot of pain and heartache in your future deep linking endeavors.

这篇关于带有Facebook的Android Deeplink无法正常工作-重定向到Play商店而不是启动应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆