iAd not working

I am quite new to iOS development; I tried adding an iAd banner to my single page application; however the app is not displaying any ads. Here is what I have done till now:


(a) Have Developer licence

(b) Added tax and other info for iAds

(c) Imported iAd framework to my app

(d) Added the line import iAd, ADBannerViewDelegate, etc.

(e) Added the line canDisplayBannerAds = true in viewDidLoad() function


But during testing, no Ads are not getting loaded


Please help.


Thanks

Aziza Khan.

Pasted is the code I am trying:


import UIKit
import iAd
var bannerView: ADBannerView!
class ViewController: UIViewController, ADBannerViewDelegate {

    override func viewDidLoad() {
        super.viewDidLoad()
        self.canDisplayBannerAds = true
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }

}

I treid putting the following statementto check whether Ads are getting displayed:


self.canDisplayBannerAds = true
print("Ad is shown???? ", self.displayingBannerAd)


But this returns false at all ocassions. Please help.

Hello!


The code seem to be fine. Have you checked developer settings from the testing device: Settings -> Developer? There's iAd Developer App Testing part where fill rate should be bigger than 0 %. If fill rate is set to zero, ads will never be loaded.


Regards

Jyri

Hi Jyri


Thanks for the response.


Currently I am testing only on simulator; but, iAds does not show up on simulator?


Thanks

Aziza Khan

I tried on iPAD; still not showing any Ads. Checked the fill rates and other options; all are set to maximum. Fill Rate - 100%; Ad Refresh Rate - 15s; Unlimited Ad Presentation, etc.

Hi!


iAds should work on simulator also, at least I get them to work with simulator.


Only thing that comes to my mind looking at your code is that you have bannerview variable and ADBannerViewDelegate but you use neither in your code. And also you don't implement the delegate. Try to delete ADBannerViewDelegate protocol and bannerview delegate. I have included the code below which works for me.


import UIKit
import iAd
class ViewController: UIViewController {

    override func viewDidLoad() {       
        super.viewDidLoad()
        self.canDisplayBannerAds = true
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }
}


You need also import iAd framework to your project. From the navigator, click the topmost item e.g. your project, then select your app from targets and in Build Phases page you need to select Link Binary With Libraries where you can add iAd framework via plus symbol.


Regards

Jyri

You do not need the bannerView object nor to add the delegate, just canDisplayBannerAds. Give it a few moments to load, a sample will be displayed in the simulator. Checking if the banner is displayed immediately after will likely return false as the banner will not immediately be on screen.


Hope that helps.


-Josh

Hi Josh, Jyri


Thank you for being supportive; tried all of these, still no Ads showing up ... Not having any idea how to proceed.... 😐


Regards

Aziza Khan

My iad requests and impressions dropped to zero around mid-Oct 2015 and I haven't seen them start up again even after releasing an update (making sure the tests ads worked during debug and through testflight) more than a week ago. Would love to either get a response why or have my app start receiving impressions.

Case number: 1032068289

iAd not working
 
 
Q