1
AdMob(320x50バナー)をプロジェクトに追加し、デバッグモードで正常にテストしました。プロダクションビルドの場合、私はProGuardの難読化を有効にし、バナーは消えました。 私はこれらのProGuardの規則を使用して試してみたが、それは影響しません:ProGuardを有効にしてAdMobバナーを空白にする
-keep public class com.google.android.gms.ads.** {
public *;
}
-keep public class com.google.ads.** {
public *;
}
私のような私のApplicationクラスでのAdMobを初期化:
XMLレイアウトでMobileAds.initialize(getApplicationContext(), getString(R.string.banner_ad_id));
私はバナーを配置します。
<com.google.android.gms.ads.AdView
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/adView"
android:layout_width="match_parent"
android:visibility="gone"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
ads:adSize="BANNER"
ads:adUnitId="@string/banner_ad_unit_id">
</com.google.android.gms.ads.AdView>
この後、このようにバナーを読み込みます。
AdView adMobView = (AdView) bannerLayout.findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
adMobView.loadAd(adRequest);
また、私は2番目の広告プロバイダー(adtech)を使用しており、状況に応じて視認性を持って遊んでいます。 どのように見えるようにしたらいいですか?
バナー広告の導入状況を表示できますか? –
私はadmobを使用しませんが、私は[これらの設定](https://github.com/firebase/quickstart-android/blob/master/admob/app/proguard-rules.pro#L19-L20)にサンプルプロジェクト。 –