Reputation: 127
I have an app that I want to display a banner ad on the bottom of the screen. Test ads are appearing, and the following code used to work for real ads. Unfortunately, my AdMob account got suspended, but when it was reinstated I expected the ads to begin appearing again. I still have not seen any banner ads appear even though test ads still work.
class GameViewController: UIViewController, GADBannerViewDelegate {
private let banner: GADBannerView = {
GADMobileAds.sharedInstance().requestConfiguration.testDeviceIdentifiers = [myTestIDString]
let banner = GADBannerView()
banner.adUnitID = AdMob.bannerid
let request = GADRequest()
banner.load(request)
return banner
}()
override var prefersStatusBarHidden: Bool {
return true
}
override func viewDidLoad() {
super.viewDidLoad()
//adds AdMob BannerAd to view
banner.rootViewController = self
banner.delegate = self
view.addSubview(banner)
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
banner.frame = CGRect(x: 0, y: view.frame.size.height-50, width: view.frame.size.width, height: 50).integral
}
}
I am getting the following error even though I added -ObjC in 'Other Linker Flags' setting of your build target.
Cannot find an ad network adapter with the name(s): com.google.DummyAdapter. Remember to link all required ad network adapters and SDKs, and set -ObjC in the 'Other Linker Flags' setting of your build target.
Is there a reason real ads are still not appearing? It has been nearly a month since my account was reinstated.
Upvotes: 3
Views: 2385
Reputation: 511
Here is a few things you can try.
Make sure your pod file is up to date with the latest pod 'Google-Mobile-Ads-SDK'
Make sure your "App Privacy" is correct as adMob ads collect lots of data from your users. Here is a tutorial - https://levelup.gitconnected.com/filling-out-the-app-privacy-section-in-app-store-connect-for-admob-users-bca0768ad86e?gi=aa4b25a3518e
Set your eCPM Floor to disabled in your ad unit settings.
If you do use mediation, make sure your ad network adapter is up to date and installed.
As per this link https://stackoverflow.com/a/35227668/14482253. Re-add your ad units.
Upvotes: 2