1
0
mirror of https://github.com/wulkanowy/wulkanowy.git synced 2025-01-19 00:16:48 -06:00

Disable personalized ads in single support advert (#1665)

This commit is contained in:
Rafał Borcz 2021-11-20 16:46:14 +01:00 committed by GitHub
parent a48e4eb4ee
commit a59d10b6c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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(