Android Google AdMob: Could not parse Event FE preflight response BUT I have correctly indicated the Publisher ID

此生再无相见时 提交于 2020-07-23 08:49:07

问题


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);
                                    }
                                });
                            }
                        }
                    }

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: Could not parse Event FE preflight response.

What could I do to fix this bug?

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.


回答1:


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.

  1. 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")

  2. Be sure to specify your Publisher ID in the Publisher IDs array for the Consent API (https://support.google.com/admob/answer/2784578)

  3. 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)

  4. Wait <= 24 hours

  5. Following the above docs, create your AdMob "app", etc.

  6. 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)

  7. [Not-Tested but found on the Internet] In your App-Level Gradle file, be sure to have:

    minifyEnabled false

    proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

Then it should work.




回答2:


The error may appear if your AdMob account isn't yet approved. Wait until the "Under Review" message disappear and try again.



来源:https://stackoverflow.com/questions/61405294/android-google-admob-could-not-parse-event-fe-preflight-response-but-i-have-cor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!