在 consent SDK admob 中为个性化广告在 bundle extras 中添加 npa 0 是否有效?

Is valid add npa 0 in bundle extras for personalized ads in consent SDK admob?

希望你一切都好

在捆绑包中添加 npa 0 以请求个性化广告是否有效,或者我们需要为此创建另一个对象?

根据文档这里所说的 Forward consent to the Google Mobile Ads SDK

这用于请求非个性化广告

Bundle extras = new Bundle();
extras.putString("npa", "1");
AdRequest request = new AdRequest.Builder()
        .addNetworkExtrasBundle(AdMobAdapter.class, extras)
        .build();

根据文档说:

If non-personalized ads are requested, the ad request URL currently includes &npa=1. However, note that this is an internal implementation detail of the Google Mobile Ads SDK and is subject to change.

如果我想请求个性化广告,我可以输入 0 吗?

Bundle extras = new Bundle();extras.putString("npa", "0");

提前致谢

如果您想请求个性化广告,则无需使用addNetworkExtrasBundle()

简单使用,

AdRequest.Builder builder = new AdRequest.Builder();
if (/*Request non-personalized ads*/) {
    Bundle extras = new Bundle();
    extras.putString("npa", "1");
    builder.addNetworkExtrasBundle(AdMobAdapter.class, extras);
}
AdRequest request = builder.build();