Play interstitial ad every 3rd game

让人想犯罪 __ 提交于 2019-12-13 21:44:09

问题


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:


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++;
}


来源:https://stackoverflow.com/questions/32642475/play-interstitial-ad-every-3rd-game

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!