Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to receive Facebook Deep Link data

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

like image 216
Linh Avatar asked Aug 27 '17 03:08

Linh


People also ask

How do I find the deep link to my Facebook page?

To deep link to a specific page, use fb://page/{page_id} for Android and fb://profile/{page_id} for iOS. Tested on Facebook iOS v57. 0 and Android v80. 0.0.

How do I access deep link?

Adjust Deeplink Generator To use the tool, log in to your Adjust dashboard and open the Menu, where you'll see the 'Deeplink Generator' as an option. Click to open, and you'll find a page to input the information required to create your deep link. Then simply copy and paste into whichever campaign you've set up.

What are Facebook deep links?

A deep link is a link that goes not only to your app, but to a specific piece of content within your app. Without deep links, people have to search through your app for the content they are looking for, and you risk them losing interest.


1 Answers

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

like image 72
Duda Avatar answered Nov 08 '22 06:11

Duda