Skip to content

Commit

Permalink
[#2220] Fix iOS Interstitial ad crash when attempting to show it on b…
Browse files Browse the repository at this point in the history
…ackground (#2221)
  • Loading branch information
mustafaozhan committed Mar 19, 2023
1 parent 21ef677 commit ec8333e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions ios/CCC/Util/InterstitialAd.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@ final class InterstitialAd: NSObject, GADFullScreenContentDelegate {
return
}

interstitialAd?.fullScreenContentDelegate = self
interstitialAd?.present(
fromRootViewController: WindowUtil.getCurrentController()
)
if UIApplication.shared.applicationState == .active {
interstitialAd?.fullScreenContentDelegate = self
interstitialAd?.present(
fromRootViewController: WindowUtil.getCurrentController()
)
} else {
logger.d(message: { "InterstitialAd not showed appState is not active" })
}
}
)
}
Expand Down

0 comments on commit ec8333e

Please sign in to comment.