You do need to call [self.delegate customEventBanner:self didReceiveAd:bannerView_];
at some point in your custom event flow. If you don't do so within about 5 seconds of requestBannerAd:parameter:label:request:
being invoked, AdMob Mediation will time out on the request to your custom event and move on. That's why you're seeing the message:
Error Domain=com.google.ads Code=9 "Request Error: No ad to show from all configured ad networks." UserInfo=0x1e8e31a0 {NSLocalizedDescription=Request Error: No ad to show from all configured ad networks., NSLocalizedFailureReason=Request Error: No ad to show from all configured ad networks.}
As far as when to invoke [self.delegate customEventBanner:self didReceiveAd:bannerView_];
, it depends on your custom event. If your custom event just returns a static image, you can invoke didReceiveAd:
directly in requestBannerAd:parameter:label:request:
with that image.
But if you're implementing some ad network that AdMob Mediation doesn't already support, chances are they will have some kind of listener to tell you when they received an ad (in AdMob's case, that would be GADBannerViewDelegate
's adViewDidReceiveAd
callback). You should listen for that network's received ad callback and in that listener invoke didReceiveAd:
.
For your main GADRequest
to AdMob that ends up triggering your custom event, you should set a GADBannerViewDelegate
on your GADBannerView
to listen for the callbacks from your custom event or any other network you may have in your mediation flow. If you get adViewDidReceiveAd:
, you know AdMob Mediation found an ad from one of your networks.