gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 23:50:50 37 4
gpt4 key购买 nike

我尝试将 Google 同意与用户消息传递平台一起使用,以在 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());
}
});

最佳答案

TestDeviceHashedId 与 Admob 设备 ID 不同。
所以删除这一行:

.addTestDeviceHashedId(getString(R.string.ADMOB_REAL_DEVICE_HASH_ID_FOR_TESTING))
然后运行您的代码并检查日志。您应该使用的 TestDeviceHashedId 将出现。

关于java - Android 同意信息发布者配置错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65134891/

37 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com