点击帖子

时间:2017-10-04 20:34:42

标签: android facebook deep-linking applinks

我在Android上遇到Facebook App Links的一些问题。问题:点击包含我应用内容网址的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的我的内容网址复制粘贴到Chrome标签中。这正确地重定向到我的Android应用。

b)添加&#34; al:android:url&#34;,&#34; al:android:package&#34;,&#34; al:android:app_name&#34;,&#34; og :url&#34;和&#34; al:web:should_fallback&#34; (false)我所有内容网页的元属性,其中&#34; og:url&#34;和&#34; al:android:url&#34;包含在a)中测试的相同值。

我是否需要为Facebook App Links注册我的应用程序? /耸肩

我非常感谢有关可能出现问题的任何想法。

1 个答案:

答案 0 :(得分:0)

这里的问题是您在以下元标记中使用Android App Link:

<meta property="al:android:url" content="https://api.intabc.com/client/redirect/artist/09faslk9-a0d7-3bed-97c5-0923fjlasd9f0">

Facebook仅支持来自其原生应用的URI方案深层链接。因此,如果网址使用httpshttp,则该链接将由Facebook浏览器处理。

选项1

更改您的al:android:url以使用Android应用的URI方案,类似于您在iOS中所做的操作。如果al:web:should_fallback设置为true

,则会在安装后打开您的应用,或者回退到您的网址

选项2(最佳选择)

Branch(我在那里工作)处理您的深层链接。它就这么简单。