From a59d10b6c1d30ca355a1a3d44bfc9201afcd0d4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Borcz?= Date: Sat, 20 Nov 2021 16:46:14 +0100 Subject: [PATCH] Disable personalized ads in single support advert (#1665) --- app/src/play/java/io/github/wulkanowy/utils/AdsHelper.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/play/java/io/github/wulkanowy/utils/AdsHelper.kt b/app/src/play/java/io/github/wulkanowy/utils/AdsHelper.kt index f363c13f..dde4d012 100644 --- a/app/src/play/java/io/github/wulkanowy/utils/AdsHelper.kt +++ b/app/src/play/java/io/github/wulkanowy/utils/AdsHelper.kt @@ -1,6 +1,8 @@ package io.github.wulkanowy.utils import android.content.Context +import android.os.Bundle +import com.google.ads.mediation.admob.AdMobAdapter import com.google.android.gms.ads.AdRequest import com.google.android.gms.ads.LoadAdError import com.google.android.gms.ads.MobileAds @@ -18,7 +20,10 @@ class AdsHelper @Inject constructor(@ApplicationContext private val context: Con suspend fun getSupportAd(): RewardedInterstitialAd? { MobileAds.initialize(context) - val adRequest = AdRequest.Builder().build() + val extra = Bundle().apply { putString("npa", "1") } + val adRequest = AdRequest.Builder() + .addNetworkExtrasBundle(AdMobAdapter::class.java, extra) + .build() return suspendCoroutine { RewardedInterstitialAd.load(