延迟深层链接的Facebook广告在android应用中无效链接数据始终为null

时间:2018-10-30 16:29:16

标签: android facebook facebook-ads-api

我集成了广告的Facebook延迟深层链接,对于新安装的应用程序链接数据始终为空

清单文件更改完成。

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

启动器活动中的代码更改:

   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);
    }

尝试从Facebook广告轮播中安装应用程序,并将延迟的深层链接设置为quickride:// utm_source = facebook

但是这些url和链接数据始终发布为null,

用例是在安装和首次启动时将utm参数设置为延迟的深层链接到应用程序,然后解析这些参数并保存到数据库中。

请检查方法和解决方案的帮助

1 个答案:

答案 0 :(得分:0)

我正因为忘记选中“延迟发送”复选框而面临同样的问题。

如果没有帮助,请遵循他们的official instruction

否则,集成branch io会更容易,而且他们拥有更好的支持团队。

enter image description here