在我的Google Play Android应用程序中,我正在从测试代码转换为现实生活中的Admob代码。
一。初始化:
MobileAds.initialize(m_Context, myAppId);
这个
myAppId
这是对的吗?
一开始就像
"ca-app-pub-7..."
2。横幅广告
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
app:adSize="BANNER"
app:adUnitId="XXX"/>
这个
XXX
AdMob称之为横幅广告UnitId。
一开始就像
.
三。插页式广告
mInterstitialAd = new InterstitialAd(m_Context);
mInterstitialAd.setAdUnitId(adIdInterstitial);
这个
adIdInterstitial
这是对的吗?
一开始就像
“ca-app-pub-7…”
.
四。欧盟的隐私问题。
implementation 'com.google.android.ads.consent:consent-library:1.0.6'
你需要打电话给:
ConsentInformation consentInformation = ConsentInformation.getInstance(m_Context);
String[] publisherIds = {adManagerNetworkCode};
consentInformation.requestConsentInfoUpdate(publisherIds, new ConsentInfoUpdateListener() {
... etc
我完全不知道绳子是什么
adManagerNetworkCode
有人能告诉我这是什么吗?
5个。我手机的测试设备Id。
在我的代码中有一个字符串叫做
myDeviceIdForTestConsent
mInterstitialAd.loadAd(new AdRequest.Builder()
.addTestDevice(myDeviceIdForTestConsent) // Todo: Remove in Release build
.build());
我可以把这个放在里面放吗?
这就是AdMod看到的东西吗?这样我可以继续测试我的代码,但是当我只是测试时,他们不会不公平地给我钱吗?如果是这样的话,我一定要把这个留下?