How to receive Facebook Deep Link data

535 views Asked by At

In AndroidManifest I have

<activity android:name=".MainActivity">
    <intent-filter>
        <action android:name="android.intent.action.VIEW"/>

        <category android:name="android.intent.category.DEFAULT"/>
        <category android:name="android.intent.category.BROWSABLE"/>
        <data
            android:host="linhtestdeeplink"
            android:scheme="app"/>
    </intent-filter>
</activity>

In MainActivity

AppLinkData.fetchDeferredAppLinkData(this,
        new AppLinkData.CompletionHandler() {
            @Override
            public void onDeferredAppLinkDataFetched(final AppLinkData appLinkData) {
                // Process app link data
                Log.i("TAG", "Deep link receive" + appLinkData);
            }
        }
);

In Facebook page, I test Deep Link like

enter image description here

My app received a notification, when I click at the notification it will launch my app but the appLinkData always null.
I also send like linhtestdeeplink://tripId=1 but it also null.
Any help or suggestion would be great appreciated.
I am using facebook sdk 4.5 compile 'com.facebook.android:facebook-android-sdk:[4,5)'

1

There are 1 answers

0
Duda On

Deep link format is <scheme>://<host> so your deep link should look like this: app://linhtestdeeplink?tripId=1