Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Oztechan/CCC#4098] Add Logs for banner ad failed requests for Android #4099

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.content.Context
import android.os.Build
import android.view.WindowManager
import co.touchlab.kermit.Logger
import com.google.android.gms.ads.AdListener
import com.google.android.gms.ads.AdRequest
import com.google.android.gms.ads.AdSize
import com.google.android.gms.ads.AdView
Expand Down Expand Up @@ -112,6 +113,14 @@ internal class AdManagerImpl(context: Context) : AdManager {
val adView = AdView(context).apply {
setAdSize(finalAdSize)
adUnitId = adId
adListener = object : AdListener() {
override fun onAdFailedToLoad(adError: LoadAdError) {
super.onAdFailedToLoad(adError)
Exception("AdManagerImpl getBannerAd onAdFailedToLoad ${adError.message}").let {
Logger.e(it) { it.message.orEmpty() }
}
}
}
loadAd(adRequest)
}

Expand Down