Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook Deep Linking not working in Android

Anyone have any idea why I am getting Deferred Deep linking issue. please check below screenenter image description hereshot.

like image 510
Ashish Jain Avatar asked Oct 28 '25 03:10

Ashish Jain


1 Answers

You have to add below line of code in onCreate method:

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ...
    FacebookSdk.sdkInitialize(this);
    Uri targetUrl =
      AppLinks.getTargetUrlFromInboundIntent(this, getIntent());
    if (targetUrl != null) {
        Log.i("Activity", "App Link Target URL: " + targetUrl.toString());
    } else {
        AppLinkData.fetchDeferredAppLinkData(
            activity, 
            new AppLinkData.CompletionHandler() {
                @Override
                public void onDeferredAppLinkDataFetched(AppLinkData appLinkData) {
                    //process applink data
                }
            });
    }
}

Refer to https://developers.facebook.com/docs/app-invites/android

like image 52
Myth Avatar answered Oct 30 '25 23:10

Myth