问题
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.
回答1:
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:
Or make sure you pasted it correctly.
Hope this helps!
来源:https://stackoverflow.com/questions/55798529/android-consentinformation-could-not-parse-event-fe-preflight-response