Josh Schlabach
Josh Schlabach

Reputation: 411

App released iAd banner not displaying ads

My application just got released on the App Store last Friday. Currently, there is a white banner at the bottom of the screen where ads are supposed to display. However, there are no ads shown at all. What's the problem?

iAd implementation:

func loadBanner() {
    adBanner = ADBannerView(frame: CGRect.zero)
    adBanner.center = CGPoint(x: adBanner.center.x, y: view.bounds.size.height - adBanner.frame.size.height/2)
    adBanner.delegate = self
    adBanner.hidden = true
    view.addSubview(adBanner)
}

func bannerViewDidLoadAd(banner: ADBannerView!) {
    adBanner.hidden = false
}

func bannerView(banner: ADBannerView!, didFailToReceiveAdWithError error: NSError!) {
    adBanner.hidden = false
}

func bannerViewActionShouldBegin(banner: ADBannerView!, willLeaveApplication willLeave: Bool) -> Bool {
    return true
}

Upvotes: 1

Views: 60

Answers (1)

Daniel Storm
Daniel Storm

Reputation: 18898

Once your application is approved for sale on the App Store it will also be reviewed by the iAd team before iAd advertisements are delivered to your application. This review can take up to 10 business days. If you are still not receiving advertisements after this time you should contact Apple directly.

The reason you're seeing an empty white rectangle is because you are showing your ADBannerView when it actually fails to receive an ad here:

func bannerView(banner: ADBannerView!, didFailToReceiveAdWithError error: NSError!) {
    adBanner.hidden = false
}

You need to change this to hide the ADBannerView like so:

func bannerView(banner: ADBannerView!, didFailToReceiveAdWithError error: NSError!) {
    adBanner.hidden = true
}

Besides this, the rest of your implementation looks ok.

Upvotes: 1

Related Questions