I am facing this issue for very long time now.
- Test Ads Appearing on Simulator and Actual Phone.
- Implementation is Correct and Latest.
- AdMob Account is approved, payment info added.
- 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)