Android-ConsentInformation-无法解析事件FE预检响应 [英] Android - ConsentInformation - Could not parse Event FE preflight response

查看:208
本文介绍了Android-ConsentInformation-无法解析事件FE预检响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在很多地方看到过此错误,但是没有人回答过解决该问题的必要原因或原因。我希望我会好运。

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

这就是我使用同意SDK的方式。我总是会遇到相同的错误:无法解析事件FE飞行前响应

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

我在gradle中的导入是实现'com.google.android.ads.consent:consent-library:1.0.6'
我正在加载的第一个片段的OnCreateView方法上运行此代码。还尝试了几秒钟后运行,以防万一这是个计时问题……还是同样的错误。
还尝试在发布者ID中的 pub 之前添加 ca-app-前缀...相同的结果。

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.

我们将提供任何帮助。

推荐答案

请确保您'正在使用发布者ID ,而不是应用ID

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

发布者ID 是您的AdMob帐户的唯一标识符。
看起来像这样的 pub-7100389293873601

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

应用ID 是分配给您的应用的唯一ID。看起来像这样的 ca-app-pub-7100382293173983〜6849306728

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

您可以有多个应用ID( (每个应用程序)),但您的帐户只能有一个发布者ID。

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

您可以在

或确保您正确粘贴了它。

Or make sure you pasted it correctly.

希望这会有所帮助!

这篇关于Android-ConsentInformation-无法解析事件FE预检响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆