Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - ConsentInformation - Could not parse Event FE preflight response

Tags:

android

ads

admob

I ve seen this error posted in many places but no one has ever answered what needs to be done to fix it or why is it happening. I m hoping I ll have better luck.

ConsentInformation consentInformation = ConsentInformation.getInstance(getActivity());
String[] publisherIds = {"pub-**********~*******"};
consentInformation.requestConsentInfoUpdate(publisherIds, new ConsentInfoUpdateListener() {


    @Override
    public void onConsentInfoUpdated(com.google.ads.consent.ConsentStatus consentStatus) {
         //do something
    }

    @Override
    public void onFailedToUpdateConsentInfo(String errorDescription) {
        Log.e("GDPR ", errorDescription);
    }
});

This is how I am using the consent sdk. I always get the same error: Could not parse Event FE preflight response

My import in gradle is implementation 'com.google.android.ads.consent:consent-library:1.0.6' I am running this code on the OnCreateView method of the first fragment loaded. Also tried running a few seconds later in case it was a timing thing...still the same error. Also tried adding the ca-app- prefix before the pub in publisher id...same result.

Any help is appreciated.

like image 525
Anonymous Avatar asked Apr 22 '19 17:04

Anonymous


1 Answers

Make sure that you're using Publisher ID and not App ID

Publisher ID is the unique identifier for your AdMob account. Looks something like this pub-7100389293873601

App ID is the unique ID assigned to your app. It looks something like this ca-app-pub-7100382293173983~6849306728.

You can have multiple App IDs (for each app) but you can only have one Publisher ID for your account.

You can find your publisher ID in you AdMob Settings: enter image description here

Or make sure you pasted it correctly.

Hope this helps!

like image 103
Kirill Karmazin Avatar answered Oct 25 '22 08:10

Kirill Karmazin