mirror of
https://github.com/wulkanowy/wulkanowy.git
synced 2025-01-19 06:36:53 -06:00
Disable personalized ads in single support advert (#1665)
This commit is contained in:
parent
a48e4eb4ee
commit
a59d10b6c1
@ -1,6 +1,8 @@
|
|||||||
package io.github.wulkanowy.utils
|
package io.github.wulkanowy.utils
|
||||||
|
|
||||||
import android.content.Context
|
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.AdRequest
|
||||||
import com.google.android.gms.ads.LoadAdError
|
import com.google.android.gms.ads.LoadAdError
|
||||||
import com.google.android.gms.ads.MobileAds
|
import com.google.android.gms.ads.MobileAds
|
||||||
@ -18,7 +20,10 @@ class AdsHelper @Inject constructor(@ApplicationContext private val context: Con
|
|||||||
suspend fun getSupportAd(): RewardedInterstitialAd? {
|
suspend fun getSupportAd(): RewardedInterstitialAd? {
|
||||||
MobileAds.initialize(context)
|
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 {
|
return suspendCoroutine {
|
||||||
RewardedInterstitialAd.load(
|
RewardedInterstitialAd.load(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user