Google AdMob iOS - No Ads to Show

Viewed 236

I am facing this issue for very long time now.

  1. Test Ads Appearing on Simulator and Actual Phone.
  2. Implementation is Correct and Latest.
  3. AdMob Account is approved, payment info added.
  4. App is also live as well.

Still saying no No Ads to Show. Please help me on this.

Here is code functions

func addBannerViewToView(_ bannerView: GADBannerView) {
    bannerView.translatesAutoresizingMaskIntoConstraints = false
    view.addSubview(bannerView)
    view.addConstraints(
        [NSLayoutConstraint(item: bannerView,
                            attribute: .bottom,
                            relatedBy: .equal,
                            toItem: bottomLayoutGuide,
                            attribute: .top,
                            multiplier: 1,
                            constant: 0),
         NSLayoutConstraint(item: bannerView,
                            attribute: .centerX,
                            relatedBy: .equal,
                            toItem: view,
                            attribute: .centerX,
                            multiplier: 1,
                            constant: 0)
    ])
}

I Tried this as well instead of adSize

 let request = GADRequest()
    //request.testDevices = ["e217e5a45bc6b1042b5ea044243894c0" ]

// GADMobileAds.sharedInstance().requestConfiguration.testDeviceIdentifiers = [(kGADSimulatorID as! String)]

// let bannerSize = UIDevice.current.isPad ? kGADAdSizeFullBanner : kGADAdSizeBanner

let adSize = GADAdSizeFromCGSize(CGSize(width: UIScreen.main.bounds.width,
                                            height: UIDevice.current.isPad ? 90 : 50))
    
    banner = GADBannerView(adSize: adSize)
    addBannerViewToView(banner)
    banner.adUnitID = AD_MOB_BANNER
    banner.rootViewController = self
    banner.delegate = self
    banner.load(request)
1 Answers

Seems like it was a Google Ads issue. My Code was correct and ads started appearing. It took time but ads started appearing.

Hope this helps. You can reach out to me if you are facing similar issue

Related