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

huwehgph  于 2021-07-06  发布在  Java
关注(0)|答案(0)|浏览(387)

我尝试使用谷歌同意与用户信息平台,以显示在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`.

我的代码:

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) {
                        loadForm();
                    } else {
                        setupAds();
                    }
                }
            },
            new ConsentInformation.OnConsentInfoUpdateFailureListener() {
                @Override
                public void onConsentInfoUpdateFailure(FormError formError) {
                    Log.d("gdpr", "onConsentInfoUpdateFailure, code:" + formError.getErrorCode() + ", " + formError.getMessage());
                }
            });

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题