Android Google AdMob:无法解析事件FE预检响应,但我已正确指示发布者ID [英] Android Google AdMob: Could not parse Event FE preflight response BUT I have correctly indicated the Publisher ID
问题描述
ConsentInformation consentInformation = ConsentInformation.getInstance(that);
String[] publisherIds = {"pub-XYZYXYZYXYZYXYZXY"};
consentInformation.requestConsentInfoUpdate(publisherIds, new ConsentInfoUpdateListener() {
@Override
public void onConsentInfoUpdated(ConsentStatus consentStatus) {
Consent consent = new Consent();
if(!ConsentInformation.getInstance(that).isRequestLocationInEeaOrUnknown()) {
consentCallback(that, new AdRequest.Builder().build());
} else {
if(consentStatus == ConsentStatus.NON_PERSONALIZED) {
Bundle extras = new Bundle();
extras.putString("npa", "1");
AdRequest adRequest = new AdRequest.Builder().addNetworkExtrasBundle(AdMobAdapter.class, extras).build();
consentCallback(that, adRequest);
} else if(consentStatus == ConsentStatus.PERSONALIZED) {
consentCallback(that, new AdRequest.Builder().build());
} else if(consentStatus == ConsentStatus.UNKNOWN) {
consent.collectConsent(that, miscellaneous, new ConsentInterface() {
@Override
public void callbackConsentInterface(AdRequest adRequest) {
consentCallback(that, adRequest);
}
});
}
}
}
如您所见,我已经正确指出了我的发布ID(在此类似问题中突出显示: Android-ConsentInformation-无法解析事件FE飞行前响应)。
So as you can see, I've correctly indicated my Pub ID (as highlighted in this similar question: Android - ConsentInformation - Could not parse Event FE preflight response).
但是我仍然遇到此错误:
However I still have this error:
W / System.err:无法解析事件FE飞行前响应。
W/System.err: Could not parse Event FE preflight response.
我该怎么做才能解决此错误?
What could I do to fix this bug?
我想我没有在Google AdMob中输入银行帐户信息,因此我无法对其进行测试公司和技术原因。
I precise that I didn't enter my bank account information in Google AdMob, and I can't do it to test for firm and technical reasons.
推荐答案
我仅通过严格遵循我想象的三个步骤就解决了我的问题。我已经测试了它们的几乎所有组合:如果不执行这些步骤之一,则将得到此无法解析事件。否则,您不会收到此错误。
I have solved my problem simply by strictly following those three steps I've imaginated. I've tested almost all combinations of them: if one of these steps isn't followed, you will get this "Could not parse Event". Otherwise, you won't get this error.
-
请遵循以下文档: https://developers.google.com/admob/android/eu-consent + https://firebase.google.com/docs/admob ( Android入门)+ https://developers.google.com/admob ( Android设置)
Follow these docs: https://developers.google.com/admob/android/eu-consent + https://firebase.google.com/docs/admob ("Get started for Android") + https://developers.google.com/admob ("Android setup")
请确保在Consent API的发布者ID数组中指定您的 Publisher ID( https://support.google.com/admob/answer/2784578 )
Be sure to specify your Publisher ID in the Publisher IDs array for the Consent API (https://support.google.com/admob/answer/2784578)
重要提示:在您的Google AdMob帐户中填写您的付款信息( https:// apps .admob.com / v2 / payments / s ()(不是说您的信用卡或任何其他付款方式,而是您的生活坐标)
Important: fill-in your payments informations in your Google AdMob account (https://apps.admob.com/v2/payments/settings) (not speaking about your credit card or any other payment method, but about your living coordinates)
等待< = 24小时
Wait <= 24 hours
按照上述文档,创建您的AdMob应用等。
Following the above docs, create your AdMob "app", etc.
Be确保已在阻止控件>欧盟同意>选择广告技术提供商中选择了一些提供商( https://apps.admob.com/v2/pubcontrols/eu-user-consent )(通常不可能不选择某些内容)
Be sure to have selected some providers in "Blocking Controls > EU Consent > Select ad technology providers" (https://apps.admob.com/v2/pubcontrols/eu-user-consent) (normally it's impossible to not have selected something)
[未经测试,但可以在Internet上找到]在您的应用程序级Gradle文件中,请确保具有:
[Not-Tested but found on the Internet] In your App-Level Gradle file, be sure to have:
minifyEnabled false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
然后它应该可以工作。
这篇关于Android Google AdMob:无法解析事件FE预检响应,但我已正确指示发布者ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!