单击广告预览时,Facebook延迟的深层链接不起作用

问题描述 投票:2回答:1
<activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:screenOrientation="sensorLandscape">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>


        <intent-filter android:autoVerify="true">
            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />

            <!-- Accepts URIs that begin with "memoryc://cerebrotrial” -->
            <data
                android:host="cerebrotrial"
                android:scheme="memoryc" />
        </intent-filter>

    </activity>

[当我从Facebook的广告助手中测试广告时,成功发送了延迟链接。但是,当我从Facebook应用程序单击广告预览时,延迟的深层链接为null。我尝试与以下实现进行深度链接。我首先尝试从AppLinkData获取深层链接,然后从最基本的getIntent()实现中获取,最后通过bolts.Applinks获得深层链接。 ApplinkData为空,意图不返回任何内容,targetUrl为空。

    // Suggested Facebook implementation
    FacebookSdk.setAutoInitEnabled(true);
    FacebookSdk.fullyInitialize();
    AppLinkData.fetchDeferredAppLinkData(this,
            new AppLinkData.CompletionHandler() {
                @Override
                public void onDeferredAppLinkDataFetched(AppLinkData appLinkData) {
                    // Process app link data
                    if (appLinkData != null) {
                        ConfigAPI.setRefererURL(appLinkData.getTargetUri().toString());
                        JsonObject jsonParams = ConfigAPI.getPayLoad();
                        new CallAPI(jsonParams).execute();
                    }
                }
            }
    );


    //persist deep link data
    Intent intent = getIntent();
    Uri data = intent.getData();
    if (data != null) {
        Log.i("DEEP LINK", data.toString());
        ConfigAPI.setRefererURL(data.toString());
        JsonObject jsonParams = ConfigAPI.getPayLoad();
        new CallAPI(jsonParams).execute();
    }

    // using the bolts.Applinks
    Uri targetUrl = AppLinks.getTargetUrlFromInboundIntent(this, getIntent());
    if (targetUrl != null) {
        ConfigAPI.setRefererURL(targetUrl.toString());
        JsonObject jsonParams = ConfigAPI.getPayLoad();
        new CallAPI(jsonParams).execute();
    }
android facebook deep-linking deferred
1个回答
0
投票
有。我也遇到了同样的问题。
© www.soinside.com 2019 - 2024. All rights reserved.