这方面没有太多文档。我想知道我们应该先打电话吗
RequestConfiguration conf= new RequestConfiguration.Builder()
.setMaxAdContentRating(
MAX_AD_CONTENT_RATING_T)
.build();
MobileAds.setRequestConfiguration(conf);
MobileAds.initialize(context, APP_ID);
Or
MobileAds.initialize(context, APP_ID);
RequestConfiguration conf= new RequestConfiguration.Builder()
.setMaxAdContentRating(
MAX_AD_CONTENT_RATING_T)
.build();
MobileAds.setRequestConfiguration(conf);
In https://developers.google.com/admob/android/quick-start https://developers.google.com/admob/android/quick-start
尽管 Google 建议致电MobileAds.initialize
越早越好
在加载广告之前,让您的应用程序初始化移动广告 SDK:
调用 MobileAds.initialize() 来初始化 SDK 并调用
一旦初始化完成(或在
30 秒超时)。此操作只需执行一次,最好在应用程序中执行
发射。
他们还提到需要在之前设置“特定于请求的标志”MobileAds.initialize
.
警告:广告可能由移动广告 SDK 或中介预加载
调用 MobileAds.initialize() 时的合作伙伴 SDK。如果你需要
获得欧洲经济区 (EEA) 用户的同意,设置任何
请求特定的标志(例如 tagForChildDirectedTreatment 或
tag_for_under_age_of_consent),或在加载前采取其他措施
广告,请确保在初始化移动广告 SDK 之前执行此操作。
所以,不太清楚应该先调用哪个。
根据Google Developer的支持,以下是正确的方法
https://groups.google.com/forum/#!category-topic/google-admob-ads-sdk/android/17oVu0sABjs 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);
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)