小编Ham*_*mir的帖子

Android 同意信息发布者配置错误

我尝试将 Google Consent 与用户消息传递平台结合使用,以在 Android 应用同意表中显示。我遵循此文档https://developers.google.com/admob/ump/android/quick-start

我收到此错误:

onConsentInfoUpdateFailure: Publisher misconfiguration: Failed to read publisher's account configuration; please check your configured app ID. Received app ID: `ca-app-pub-XXXXXXXXXXXXXXXX~XXXXXXXXXX`.
Run Code Online (Sandbox Code Playgroud)

我的代码:

ConsentRequestParameters params;

    if (testingGDPR) {

        ConsentDebugSettings debugSettings = new ConsentDebugSettings.Builder(this)
                .setDebugGeography(ConsentDebugSettings.DebugGeography.DEBUG_GEOGRAPHY_EEA)
                .addTestDeviceHashedId(getString(R.string.ADMOB_REAL_DEVICE_HASH_ID_FOR_TESTING))
                .build();

        params = new ConsentRequestParameters.Builder().setConsentDebugSettings(debugSettings).build();
    } else {
        params = new ConsentRequestParameters.Builder().build();
    }

    consentInformation = UserMessagingPlatform.getConsentInformation(this);

    if (testingGDPR) {
        consentInformation.reset();
    }

    consentInformation.requestConsentInfoUpdate(
            this,
            params,
            new ConsentInformation.OnConsentInfoUpdateSuccessListener() {
                @Override
                public void onConsentInfoUpdateSuccess() {
                    
                    if (consentInformation.isConsentFormAvailable() && consentInformation.getConsentStatus() == ConsentInformation.ConsentStatus.REQUIRED) { …
Run Code Online (Sandbox Code Playgroud)

java android admob gdprconsentform user-messaging-platform

5
推荐指数
1
解决办法
1517
查看次数