1

I implemented both iAd and AdMob to my project. The structure is if an error comes from iAd server, the app going to show Admob banner or interstitial according to error ad type. Interstitial works fine. But not banners. I used the function shown below and I selected the iAd fill rate to 0% in developer setting of simulator. But it's not writing "WORKED" to console and it's not showing iAd Banner ad(as expected). How can I solve this problem?

func bannerView(banner: ADBannerView!, didFailToReceiveAdWithError error: NSError!) {
        println("WORKED")

    }
do it better
  • 4,627
  • 6
  • 25
  • 41

1 Answers1

1

You're probably not setting your ADBannerView's delegate properly. Your code should look similar to this:

class ViewController: UIViewController, ADBannerViewDelegate { // Include the delegate for our ADBannerView

And then wherever you are setting up your ADBannerView you need to set its delegate. For example:

yourAdBannerView.delegate = self

You will probably want to print your error also so you know why it has failed. For example:

func bannerView(banner: ADBannerView!, didFailToReceiveAdWithError error: NSError!) {
    println("didFailToReceiveAdWithError: \(error)")
}
Daniel Storm
  • 18,301
  • 9
  • 84
  • 152
  • Thank you for your plain response. I think I wrote something wrong. I used another solution and pasted the link above. Thanks http://stackoverflow.com/questions/30386514/app-approved-but-no-admob-ads-appearing/30413810#30413810 – do it better Aug 29 '15 at 10:34
  • @twigofa I've updated [that](http://stackoverflow.com/a/30413810/2108547) answer to include the code I mention here. – Daniel Storm Aug 31 '15 at 10:00