gpt4 book ai didi

android - 我们应该先调用 MobileAds.setRequestConfiguration 还是 MobileAds.initialize?

转载 作者:行者123 更新时间:2023-11-29 00:52:24 28 4
gpt4 key购买 nike

这方面的文档不多。我在想,我们是不是应该先打电话

RequestConfiguration conf= new RequestConfiguration.Builder()
.setMaxAdContentRating(
MAX_AD_CONTENT_RATING_T)
.build();

MobileAds.setRequestConfiguration(conf);
MobileAds.initialize(context, APP_ID);

或者

MobileAds.initialize(context, APP_ID);
RequestConfiguration conf= new RequestConfiguration.Builder()
.setMaxAdContentRating(
MAX_AD_CONTENT_RATING_T)
.build();

MobileAds.setRequestConfiguration(conf);

https://developers.google.com/admob/android/quick-start

尽管 Google 建议尽早调用 MobileAds.initialize

Before loading ads, have your app initialize the Mobile Ads SDK by calling MobileAds.initialize() which initializes the SDK and calls back a completion listener once initialization is complete (or after a 30-second timeout). This needs to be done only once, ideally at app launch.

他们还提到需要在 MobileAds.initialize 之前设置“特定于请求的标志”。

Warning: Ads may be preloaded by the Mobile Ads SDK or mediation partner SDKs upon calling MobileAds.initialize(). If you need to obtain consent from users in the European Economic Area (EEA), set any request-specific flags (such as tagForChildDirectedTreatment or tag_for_under_age_of_consent), or otherwise take action before loading ads, ensure you do so before initializing the Mobile Ads SDK.

所以,对于应该首先调用哪个不是很清楚。

最佳答案

根据 Google Developer 支持,以下是正确的做法

https://groups.google.com/forum/#!category-topic/google-admob-ads-sdk/android/17oVu0sABjs

RequestConfiguration conf= new RequestConfiguration.Builder()
.setMaxAdContentRating(
MAX_AD_CONTENT_RATING_T)
.build();

MobileAds.setRequestConfiguration(conf);
MobileAds.initialize(context, APP_ID);

关于android - 我们应该先调用 MobileAds.setRequestConfiguration 还是 MobileAds.initialize?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58084706/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com