Show Admob Interstitial ads between scenes in Swift SpriteKit

后端 未结 2 1402
眼角桃花
眼角桃花 2021-01-14 04:58

I would like to know how to set up Admob Interstitial ads when I present my GameOverScene. What should I do to show the ads only sometimes when the game gets over? And how d

相关标签:
2条回答
  • 2021-01-14 05:41

    You can also limit the frequency that Admob will show interstitial ads via the Admob website. In the settings for your interstitial advert, there are options to change the frequency of adverts popping up.

    0 讨论(0)
  • 2021-01-14 05:47

    why dont you use NSNotificationCenter or delegates to call showInterstitial().

    For example

    In gameViewController add this in viewDidLoad

     NSNotificationCenter.defaultCenter().addObserver(self, selector: "showInterstitial"), name:"showInterAdKey", object: nil);
    

    and when you want to show the ad from your scenes you use

     NSNotificationCenter.defaultCenter().postNotificationName("showInterAdKey", object: nil)
    

    You could also use something like the helper I posted on github which makes this even easier and your ViewController stays clean https://github.com/crashoverride777/Swift-2-iAds-and-AdMob-Helper

    0 讨论(0)
提交回复
热议问题