iossprite-kitadmobskscenesktransition

How can I wait until AdMob ad has ended to run SKScene transition?


I'm implementing AdMob ad's to my game project. I would like the ad to run first and then after the user is done watching the ad and is back to the game, I would like to run the transition. Now however the transition is being run simultaneusly with the ad and that looks bad. My code is as follows. ALL HELP APPRECIATED!

if interstitial.isReady {
                interstitial.presentFromRootViewController(self.gameViewController!)
                self.view?.presentScene(scene, transition:getTransition())
            } else {
                print("Ad wasn't ready")
                self.view?.presentScene(scene, transition:getTransition())
            }

Solution

  • AdMob has delegates that you should be using, It is called GADInterstitialDelegate. That will tell you when certain events in the ad process are happening.

    You may want to be looking at the interstitialDidDismissScreen(ad:GASInterstitial) method to achieve what you want