11
votes

I am integrated facebook deferred deep linking for ads, For new installs App Link Data is always null

Manifest file changes done.

   <activity
        android:name="com.disha.quickride.androidapp.startup.QRSplashActivity"
        android:configChanges="orientation|screenSize"
        android:label="@string/app_name"
        android:screenOrientation="portrait"
        android:theme="@style/ActivityTheme">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        <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:scheme="quickride" />
        </intent-filter>
    </activity>

Code changes in launcher activity:

   AppLinkData.fetchDeferredAppLinkData(this,"XXXXXXXXXXXXX", new AppLinkData.CompletionHandler() {
        @Override
        public void onDeferredAppLinkDataFetched(AppLinkData appLinkData) {
            try{
                Uri uri = appLinkData.getTargetUri();
                Log.d(LOG_TAG,"fetchDeferredAppLinkData URi :" +uri);
                Bundle argumentBundle = appLinkData.getArgumentBundle();
                Log.d(LOG_TAG,"fetchDeferredAppLinkData argument bundle :" +argumentBundle);
                String ref = appLinkData.getRef();
                Log.d(LOG_TAG,"fetchDeferredAppLinkData ref :" +ref);
                Bundle bundle = appLinkData.getRefererData();
                Log.d(LOG_TAG,"fetchDeferredAppLinkData RefererData : " +bundle);

            }catch (Throwable throwable){
                Log.e(LOG_TAG,"failed to parse",throwable);
            }
        }
    });
    try{
        Uri uri = getIntent().getData();
        Log.d(LOG_TAG,"fetchDeferredAppLinkDataFromIntent URi :" +uri);
        Uri targetUrl =
                AppLinks.getTargetUrlFromInboundIntent(this, getIntent());
        if (targetUrl != null) {
            Log.d(LOG_TAG, "App Link Target URL: " + targetUrl.toString());
        }else{
            Log.d(LOG_TAG, "App Link Target URL: " + targetUrl);
        }
    }catch (Throwable throwable){
        Log.e(LOG_TAG,"failed to parse",throwable);
    }

Tried installing app from facebook ad carousel, with deferred deeplink as quickride://utm_source=facebook

But these url and link data is always publish as null,

Use case is to get utm parameters set in deferred deep link to application in install and first launch and parse these parameters and save in to database.

Please check kindly help with approach and solution

1
Did you find a solution for this?Vadim Kotov

1 Answers

0
votes

I faced the same issue just because of forgetting check the 'send deferred' checkbox.

If it doesn't help, just follow their official instruction

Otherwise integrating branch io will be easier, plus they have better support team.

enter image description here