1

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?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
TroyDeJ
  • 51
  • 5
  • 1
    Since you tagged this question with iAd, you should know that iAd isn't supported any more. – rmaddy Jan 29 '17 at 01:07
  • The iAd network has been discontinued: http://stackoverflow.com/a/37347959/2108547. Look into using AdMob or any of the other [ad networks](https://www.google.com/search?q=ios+ads&ie=utf-8&oe=utf-8#q=ad+networks+for+ios). – Daniel Storm Jan 29 '17 at 14:49

2 Answers2

1

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

Pierce
  • 3,148
  • 16
  • 38
  • id like to keep it to a banner so its not annoying, its hard to balance out revenue and not being irritating lol – TroyDeJ Jan 28 '17 at 19:42
  • @TroyDeJ - Interstitials really aren't any more annoying than banner ads in my opinion. I mean all that happens is the ad shows, and you can tap to close it if you want. They say that you'll make much more from interstitials too. But if you absolutely don't want to go down that path, I don't see why you couldn't animate the alpha channel of something like a GADBannerView. Have you tried doing so? – Pierce Jan 28 '17 at 19:47
0

You've tagged your question with the 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.

Community
  • 1
  • 1
Daniel Storm
  • 18,301
  • 9
  • 84
  • 152