Play interstitial ad every 3rd game

2019-09-06 15:51发布

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?

1条回答
Root(大扎)
2楼-- · 2019-09-06 16:07

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++;
}
查看更多
登录 后发表回答