Android Deeplink with facebook not working - redir

2019-08-25 18:20发布

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

Below is my intent filter:

<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>

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.

Activity name has been specified in facebook developer account.

Please let me know what mistake am I doing.

1条回答
闹够了就滚
2楼-- · 2019-08-25 18:53

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>

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

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

More Robust Solution

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.

查看更多
登录 后发表回答