ioscocos2d-iphoneinterstitialheyzap

Play interstitial ad every 3rd game


I'm using the HeyZap mediation SDK. I have all the mediation set up perfectly fine, but I would like for the interstitial ad to show every 3rd game.

I've tried some solutions here on Stack Overflow but they apply to AdMob.

Right now, I have:

-(void) GameOver {
  ....
  [HZInterstitialAd show];
}

How do I achieve this?


Solution

  • keep a counter of the number of games played and then only show it if

    static int count = 0;
    -(void) GameOver {
      if(count != 0 && count % 3 == 0)
        [HZInterstitialAd show];
    
      count++;
    }