singletonadmobviewcontrollerbannerdidfailwitherror

how to implement ads on 2 view controllers


I want the iAd/AdMob mediation banner to NOT be affected by what ViewController I'm in. Currently. When I change View Controllers didFailToReceiveAdWithError is called and the AdMob banner in that method appears when I change ViewControllers. I use 2 ViewControllers for my entire app, so is there a way to make the ads NOT be affected by the app?


Solution

  • Seems to me like you placed an ad on each view controller. When you transition between view controllers a new ad is called. You should instead use a singular ad banner. That way no matter what view controller you're on there will always be 1 ad banner running across both screens.