App approved, but AdMob ads don't appear

My iOS app was rejected due to Apple not detecting my ads during the review process. I downloaded my app again, included instructions on how to see ads, and was approved today. Now that my friends and family have downloaded the app, ads are not showing. I checked my AdMob account and there were no impressions, so I donโ€™t know what happened. Has anyone happened to them? In addition, it has not been 24 hours since the application was approved. Since Apple approved of this, I assume they saw ads. My Apps shows ads when you start using filters after selecting a photo. AdMob displays 61 impressions, 61 requests, and 100% occupancy.

// Initialize Apple iAd banner func initiAdBanner() { iAdBannerView = ADBannerView(frame: CGRectMake(0, self.view.frame.size.height, 0, 0) ) iAdBannerView.delegate = self iAdBannerView.hidden = true view.addSubview(iAdBannerView) } // Initialize Google AdMob banner func initAdMobBanner() { if UIDevice.currentDevice().userInterfaceIdiom == UIUserInterfaceIdiom.Pad { // iPad banner adMobBannerView.adSize = GADAdSizeFromCGSize(CGSizeMake(728, 90)) adMobBannerView.frame = CGRectMake(0, self.view.frame.size.height, 728, 90) } else { // iPhone banner adMobBannerView.adSize = GADAdSizeFromCGSize(CGSizeMake(320, 50)) adMobBannerView.frame = CGRectMake(0, self.view.frame.size.height, 320, 50) } adMobBannerView.adUnitID = "AdMobPublisherID" adMobBannerView.rootViewController = self adMobBannerView.delegate = self // adMobBannerView.hidden = true view.addSubview(adMobBannerView) var request = GADRequest() adMobBannerView.loadRequest(request) } // Hide the banner func hideBanner(banner: UIView) { if banner.hidden == false { UIView.beginAnimations("hideBanner", context: nil) // Hide the banner moving it below the bottom of the screen banner.frame = CGRectMake(0, self.view.frame.size.height, banner.frame.size.width, banner.frame.size.height) UIView.commitAnimations() banner.hidden = true } } // Show the banner func showBanner(banner: UIView) { if banner.hidden == true { UIView.beginAnimations("showBanner", context: nil) // Move the banner on the bottom of the screen banner.frame = CGRectMake(0, (self.view.frame.size.height-70) - banner.frame.size.height, banner.frame.size.width, banner.frame.size.height); UIView.commitAnimations() banner.hidden = false } } // iAd banner available func bannerViewWillLoadAd(banner: ADBannerView!) { println("iAd loaded!") hideBanner(adMobBannerView) showBanner(iAdBannerView) } // NO iAd banner available func bannerView(banner: ADBannerView!, didFailToReceiveAdWithError error: NSError!) { println("iAd can't looad ads right now, they'll be available later") hideBanner(iAdBannerView) var request = GADRequest() adMobBannerView.loadRequest(request) } // AdMob banner available func adViewDidReceiveAd(view: GADBannerView!) { println("AdMob loaded!") hideBanner(iAdBannerView) showBanner(adMobBannerView) } // NO AdMob banner available func adView(view: GADBannerView!, didFailToReceiveAdWithError error: GADRequestError!) { println("AdMob Can't load ads right now, they'll be available later \n\(error)") hideBanner(adMobBannerView) } 
+4
source share
2 answers

Ads now appear in your application. When your application is approved by Apple, it must still be approved by the iAd team in order to receive iAd advertising. This may take several days. As a result, none of your advertisements were shown in your application. You can verify this by going to Settings> Developer and setting your fill rate to 0% on your development device. The reason that no ads are displayed if the iAd is not initially loaded due to this function:

  // Show the banner func showBanner(banner: UIView) { if banner.hidden == true { UIView.beginAnimations("showBanner", context: nil) // Move the banner on the bottom of the screen banner.frame = CGRectMake(0, (self.view.frame.size.height-70) - banner.frame.size.height, banner.frame.size.width, banner.frame.size.height); UIView.commitAnimations() banner.hidden = false } } 

You check if banner.hidden == true , but adMobBannerView hidden never set to true until the iAd banner is loaded. Seeing that not a single iAd banner was loaded before being approved by the iAd team, this condition was never met. This condition will also never be met in countries that do not support iAd, or if iAd does not load the ad natively.

In addition, there are many jumps when your ads load due to the fact that you simulate them on the screen and out of it. A more elegant approach would be to animate their alpha values โ€‹โ€‹so that the user doesn't notice when your ads change. You can also completely exclude your code. I rewrote what you are trying to accomplish, and commented on the reasons for this.

 import UIKit import iAd class ViewController: UIViewController, ADBannerViewDelegate, GADBannerViewDelegate { var iAdBannerView : ADBannerView = ADBannerView() var adMobBannerView : GADBannerView = GADBannerView() override func viewDidLoad() { super.viewDidLoad() loadAds() } func loadAds() { // iAd // Changed banners width to match the width of the view it is on // You need to set the y origin relative to your view. Not a static number. iAdBannerView = ADBannerView(frame: CGRectMake(0, self.view.frame.size.height - iAdBannerView.frame.height, self.view.frame.size.width, iAdBannerView.frame.height)) iAdBannerView.delegate = self view.addSubview(iAdBannerView) // Hide iAd initially iAdBannerView.alpha = 0.0 // AdMob // Changed adSize to Googles set banner size adMobBannerView.adSize = kGADAdSizeBanner // Changed banners width to match the width of the view it is on // You need to set the y origin relative to your view. Not a static number. adMobBannerView.frame = CGRectMake(0, self.view.frame.size.height - adMobBannerView.frame.height , self.view.frame.size.width, adMobBannerView.frame.height) adMobBannerView.rootViewController = self adMobBannerView.delegate = self adMobBannerView.adUnitID = "AdMobPublisherID" // Dont need var request = GADRequest() adMobBannerView.loadRequest(GADRequest()) // Do not hide AdMob initially view.addSubview(adMobBannerView) } // Use bannerViewDidLoadAd function so we know ad is fully loaded func bannerViewDidLoadAd(banner: ADBannerView!) { println("iAd has an ad to show") // Animate fade of banners UIView.beginAnimations(nil, context: nil) // Show iAd iAdBannerView.alpha = 1.0 // Hide AdMob adMobBannerView.alpha = 0.0 UIView.commitAnimations() } func bannerView(banner: ADBannerView!, didFailToReceiveAdWithError error: NSError!) { println("iAd failed to load an ad because \(error)") // Animate fade of banners UIView.beginAnimations(nil, context: nil) // Hide iAd iAdBannerView.alpha = 0.0 // Show AdMob adMobBannerView.alpha = 1.0 UIView.commitAnimations() } 

This promotes the iAd and returns to AdMob if the iAd does not load the ad. You donโ€™t need to check when AdMob doesnโ€™t load the ad, because its fill factor is almost always 100%, and if there is no AdMob ad, I doubt that the iAd ad will appear there.

+4
source

You will need to look at device logs to determine why ads were not showing. In all likelihood, at that moment there was no advertising from the ad server.

This is a normal state of affairs and why you should use mediation to make sure you have a backup network.

-1
source

All Articles