本文介绍了我们应该先调用MobileAds.setRequestConfiguration还是MobileAds.initialize吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
关于此的文档不多。我想知道,是否应该先调用
There isn't much documentation on this. I was wondering, should we first call
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);
在
尽管Google建议尽快调用 MobileAds.initialize
Although Google recommend calling MobileAds.initialize
as early as possible
他们还提到特定于请求的标志的需要可以在 MobileAds.initialize
之前进行设置。
They also mention "request-specific flags" need to be set before MobileAds.initialize
.
因此,不清楚应该先调用哪个
So, not super clear on which should be called first.
推荐答案
根据Google Developer支持,以下是正确的方法
According to Google Developer support, the following is the right way to do
RequestConfiguration conf= new RequestConfiguration.Builder()
.setMaxAdContentRating(
MAX_AD_CONTENT_RATING_T)
.build();
MobileAds.setRequestConfiguration(conf);
MobileAds.initialize(context, APP_ID);
这篇关于我们应该先调用MobileAds.setRequestConfiguration还是MobileAds.initialize吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!