Paid admob banner ad load problem in landscape

I have paid admob plugin and i am use this plugin in my 5-6 landscape game.

In landscape banner ad not load from admob server for all android devices. but in my portrait game is load fine every time and for every android devices.

Interstitial is okay for all devices.

Any one can help me ?

My Admob Code:

------ adUnit.lua --------

adUnit = {}

admob = require( “plugin.admob” )

textMode = display.newText(  “No AD”, display.contentWidth/2, 80, native.systemFont , 25 )
textMode:setFillColor( 0 )
textMode.isVisible = false

if (sysEnv == “Android”) then
    admob_appId = setting.admob_id.android.app_id

    adUnit.bannerAdId = setting.admob_id.android.adunit_id_banner
    adUnit.interstitialAdId = setting.admob_id.android.adunit_id_interstitial
    --adUnit.videoAdId = “ca-app-pub-1106092504256274/5796366149”
elseif (sysEnv == “iPhone OS”) then
    admob_appId = setting.admob_id.ios.app_id

    adUnit.bannerAdId = setting.admob_id.ios.adunit_id_banner
    adUnit.interstitialAdId = setting.admob_id.ios.adunit_id_interstitial
    – adUnit.videoAdId = “ca-app-pub-1106092504256274/5656765341”  
end

local bannerHeight = 50

adUnit.adShown = false

adUnit.adListener = function(event)
    local msg = event.response
    – Quick debug message regarding the response from the library
    print( "Message from the ads library: ", msg )
    
    if ( event.phase == “init” ) then
        
        adUnit.adLoad(“banner”)
        adUnit.adLoad(“interstitial”)   

    elseif ( event.phase == “loaded” ) then
        – an ad was preloaded
        if (event.type == “banner”) then
            bannerHeight = admob.height()
            adUnit.adShow(“banner”)
        end
        
    
    elseif ( event.phase == “closed” ) then
        
        if (event.type == “interstitial”) then
           
            adUnit.adShow(“banner”)
            
            adUnit.adLoad(“interstitial”)
            
        end

    elseif (event.phase == “failed”) then

        if (event.type == “banner”) then
            – textMode.text = “banner”

            – -- textMode.text = event.data
            – local response = json.decode(event.data)
            – loadSave.saveTable(response , “temp1.json”)
            
            – local data = loadSave.loadTable(“temp1.json”)
            – if (data == nil) then
            –     textMode.text = “Nil Value”
            – else
            –     for k,v in pairs(data) do
            –         textMode.text = textMode.text…"\n"…k…"\n"…v…"\n"
            –     end

            –     textMode.x = _W/2
            –     textMode.y = _H/2
            – end
        end       
    end
end

adUnit.adInit = function()
    
    admob.init( adUnit.adListener , { appId = admob_appId , testMode = true } )
   
end

adUnit.adShow = function( name )
    if (name == “banner”) then
       
        if (admob.isLoaded( “banner” )) then
            adUnit.adShown = true
            admob.show( “banner”, {y = display.actualContentHeight - bannerHeight } )
        else
            adUnit.adLoad(“banner”)
        end
        
    elseif (name == “interstitial”) then
        
        if (admob.isLoaded( “interstitial” )) then
            admob.show( “interstitial” )
        else
            if (adUnit.adShown == false) then
                adUnit.adShow(“banner”)
            end
            adUnit.adLoad(“interstitial”)
        end
    
    end
    
end

adUnit.adLoad = function( name )
    if (name == “interstitial”) then
        if (admob.isLoaded( “interstitial” )) then
            —
        else
            admob.load( “interstitial”, { adUnitId = adUnit.interstitialAdId } )
        end
    elseif (name == “rewardedVideo”) then   
        if (admob.isLoaded( “rewardedVideo” )) then
            —
        else
            admob.load( “rewardedVideo”, { adUnitId = adUnit.rewardedVideoAd } )
        end
    elseif (name == “banner”) then   
        if (admob.isLoaded( “banner” )) then
            —
        else
            admob.load( “banner”, { adUnitId = adUnit.bannerAdId } )
        end        
    end
end

adUnit.adHide = function()
    if (adUnit.adShown) then
        adUnit.adShown = false
        admob.hide()
    end
    
end

return

--------build.settings-------


– For more information on build.settings see the Corona SDK Build Guide at:
https://docs.coronalabs.com/guide/distribution/buildSettings

settings =
{
    orientation =
    {
        – Supported values for orientation:
        – portrait, portraitUpsideDown, landscapeLeft, landscapeRight

        default = “landscapeRight”,
        supported = { “landscapeRight”, },
    },

    
    plugins =
    {

        [“CoronaProvider.native.popup.social”] =
        {
            publisherId = “com.coronalabs”
        },

        [“plugin.google.iap.v3”] =
        {
            publisherId = “com.coronalabs”,
            supportedPlatforms = { android=true }
        },

        [“plugin.admob”] =
        {
            publisherId = “com.coronalabs”
        },
        
        [“CoronaProvider.gameNetwork.apple”] =
        {
            publisherId = “com.coronalabs”,
            supportedPlatforms = { iphone=true}
        },

           [“plugin.gpgs”] =
           {
            publisherId = “com.coronalabs”,
            supportedPlatforms = { android=true }
        },

        
    },   

    –
    – iOS Section
    –
    iphone =
    {
        plist =
        {
            UIStatusBarHidden = false,
            UIPrerenderedIcon = true, – set to false for “shine” overlay
            --UIApplicationExitsOnSuspend = true, – uncomment to quit app on suspend
            MinimumOSVersion = “7.0”,

            CFBundleIconFiles =
            {
                “Icon-40.png”,
                “Icon-58.png”,
                “Icon-76.png”,
                “Icon-80.png”,
                “Icon-87.png”,
                “Icon-120.png”,
                “Icon-152.png”,
                “Icon-167.png”,
                “Icon-180.png”,
            },
        },
    },
    
    –
    – Android Section
    –
    android =
    {    
        googlePlayGamesAppId = “735398620501”,
        usesPermissions =
        {
            “com.android.vending.BILLING”,
            “com.android.vending.CHECK_LICENSE”
            
        },
    },
}
 

When you say the ad doesn’t load, do you mean you get event.phase==“failed” for banners?

I don’t see anything wrong with your code, however I would recommend that you use y=“bottom” instead of calculating the bottom position yourself.

PS.

You should remove  MinimumOSVersion = “7.0” from your build.settings for iOS as the latest Corona public release targets iOS 8.0 and above.

Yes i getting failed and errorCode = 3 for banners in android.

And i also check by y = “bottom” but same error come.

Only problem with landscape. portrait is fine.

errorCode 3 is “No Fill”, which means AdMob found no ads to be displayed.

Are you getting this even when testMode == true?

portrait and landscape have banner different at admob server.

Because if have no fill than should not be show in portrait for same id i think.

What you think?

It’s OK to use a separate AdUnitID for portrait and landscape banners, but it’s not necessary. 

Landscape banners are not as common as portrait banners. They are of different sizes which might explain why you are seeing portrait banners being loaded, but not landscape banners.

Also please verify that Text Ads and Image Ads are activated for your banners (see screenshot below). 

Fill rate is also dependent on where you are testing from. The best fill-rate is found in US and European regions. Other regions may have lower fill rate.

When you say the ad doesn’t load, do you mean you get event.phase==“failed” for banners?

I don’t see anything wrong with your code, however I would recommend that you use y=“bottom” instead of calculating the bottom position yourself.

PS.

You should remove  MinimumOSVersion = “7.0” from your build.settings for iOS as the latest Corona public release targets iOS 8.0 and above.

Yes i getting failed and errorCode = 3 for banners in android.

And i also check by y = “bottom” but same error come.

Only problem with landscape. portrait is fine.

errorCode 3 is “No Fill”, which means AdMob found no ads to be displayed.

Are you getting this even when testMode == true?

portrait and landscape have banner different at admob server.

Because if have no fill than should not be show in portrait for same id i think.

What you think?

It’s OK to use a separate AdUnitID for portrait and landscape banners, but it’s not necessary. 

Landscape banners are not as common as portrait banners. They are of different sizes which might explain why you are seeing portrait banners being loaded, but not landscape banners.

Also please verify that Text Ads and Image Ads are activated for your banners (see screenshot below). 

Fill rate is also dependent on where you are testing from. The best fill-rate is found in US and European regions. Other regions may have lower fill rate.