Id like to add Ad banners to my game, but they would really be distracting during actual game play. Can you control when the banner will be displayed? IE: the end game screen that gives you the option to restart?
Can you control when an Ad banner will appear?
53 views Asked by TroyDeJ At
2
There are 2 answers
0
On
You've tagged your question with the iad tag but iAd has been discontinued. A popular alternative is Google's AdMob.
AdMob's GADBannerView is a subclass of UIView so you can hide and show it just like any other UIView. For example:
let myBannerAd = GADBannerView()
func startGame() {
myBannerAd.hidden = true
}
func gameOver() {
myBannerAd.hidden = false
}
Most ad networks also come with delegate methods to track ad events.
Yes you can, in fact most mobile advertisement platforms try to encourage you to do it like that. Check out interstitial ads with something like Google AdMob