【发布时间】:2017-10-04 20:34:42
【问题描述】:
我在 Android 上使用 Facebook 应用链接时遇到了一些问题。问题:单击包含指向我的应用内容 URL 的 Facebook 帖子会在 Facebook 的移动“浏览器”中打开内容网页,而不是深度链接到我的 Android 应用。
网页元数据(为隐私而修改的值):
<meta property="fb:app_id" content="983094809459723"><meta
property="og:title" content="Manchester Orchestra"><meta property="og:image" content="https://i.scdn.co/image/aj0293jfalskdfj0293asd"><meta property="og:url" content="https://api.intabc.com/client/redirect/artist/09faslk9-a0d7-3bed-97c5-0923fjlasd9f0"><meta property="al:android:url" content="https://api.intabc.com/client/redirect/artist/09faslk9-a0d7-3bed-97c5-0923fjlasd9f0"><meta property="al:ios:url" content="abc-int://artist?artist_id=09faslk9-a0d7-3bed-97c5-0923faesd9f0"><meta property="al:android:package" content="com.intabc.mobile"><meta property="al:android:app_name" content="ABC - Integration"><meta property="al:ios:app_name" content="ABC - Integration">
深层链接意图过滤器
<intent-filter android:label="@string/app_name">
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data
android:scheme="https"
android:host="api.intabc.com"
android:pathPrefix="/client/redirect/artist"/>
</intent-filter>
<intent-filter android:label="@string/app_name">
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data
android:scheme="abc-int"
android:host="artist"/>
</intent-filter>
我尝试过的事情:
a) 将我发布到 Facebook 的内容的 URL 复制粘贴到 Chrome 选项卡中。这会正确重定向到我的 Android 应用。
b) 添加了“al:android:url”、“al:android:package”、“al:android:app_name”、“og:url”和“al:web:should_fallback”(假)元属性我的所有内容网页,其中“og:url”和“al:android:url”包含在 a) 中测试的相同值。
我需要为我的应用注册 Facebook 应用链接吗? /耸肩
我将不胜感激任何关于可能是什么问题的想法。
【问题讨论】:
-
您不需要注册您的应用程序。如果配置正确,facebook 应该会打开您的应用程序。您有任何可以分享的意图过滤器或页眉代码吗?
-
@clayjones94 添加了相关代码
标签: android facebook deep-linking applinks