Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Admob interstitial ads loads once — Gideros Forum

Admob interstitial ads loads once

Hi all,

I'm testing admob interstitial ads for my game using sample ad units (https://developers.google.com/admob/android/test-ads) and I have a problem.

This is my code flow:

-> Play some levels
-> load ad
-> if received show ad (this happened)
-> play some levels more
-> load ad
-> nothing happened ( no error, no received, nothing)

If i shutdown the game and launch again, happen the same: first time load ad, and next time nothing happened.

Same code flow works with chartboost, and load ad every time i call loadAd function.


Thanks a lot.
Tagged:

Comments

  • olegoleg Member
    edited October 2019
    Admob limits the frequency of ad serving. Depending on the number of sponsors

    Likes: theone10

    my games:
    https://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
    +1 -1 (+1 / -0 )Share on Facebook
  • oleg said:

    Admob limits the frequency of ad serving. Depending on the number of sponsors

    That limit dont dispatch any event? (error, failed)
  • olegoleg Member
    edited October 2019
    theone10 said:

    oleg said:

    Admob limits the frequency of ad serving. Depending on the number of sponsors

    That limit dont dispatch any event? (error, failed)

    No


    Event.AD_DISPLAYED - The event writes something, I don't remember

    Likes: theone10

    my games:
    https://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
    +1 -1 (+1 / -0 )Share on Facebook
  • Event.AD_DISPLAYED just dispatched the first time I call showAd every time i open the game, next time nothing received.


    This is logcat, maybe the error produces not load anymore? :/


    10-22 22:24:35.556 21342-21342/? I/Ads: Updating ad debug logging enablement.
    10-22 22:24:35.582 21342-21342/? I/Ads: Use AdRequest.Builder.addTestDevice("*******************************") to get test ads on this device.
    10-22 22:24:35.724 21342-21747/? W/Ads: Update ad debug logging enablement as false
    10-22 22:24:37.484 4130-15950/? W/Ads: App does not have the required permissions to get location
    10-22 22:24:37.749 4130-21831/? E/Ads: Error waiting for future.
    java.util.concurrent.TimeoutException

    at java.util.concurrent.FutureTask.get(FutureTask.java:177)
    at com.google.android.gms.ads.internal.util.future.f.a(:com.google.android.gms@19528017@19.5.28 (040306-273329419):5)
    at com.google.android.gms.ads.cache.k.a(:com.google.android.gms@19528017@19.5.28 (040306-273329419):3)
    at com.google.android.gms.ads.nonagon.signals.gmscore.o.call(:com.google.android.gms@19528017@19.5.28 (040306-273329419))
    at bqbs.b(:com.google.android.gms@19528017@19.5.28 (040306-273329419))
    at bqaq.run(:com.google.android.gms@19528017@19.5.28 (040306-273329419):7)
    at bqbt.run(:com.google.android.gms@19528017@19.5.28 (040306-273329419):1)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
    at java.lang.Thread.run(Thread.java:818)
    10-22 22:24:37.892 4130-21831/? I/Ads: SDK version: afma-sdk-a-v18479999.12451000.1
    10-22 22:25:16.841 21342-21342/? I/Ads: Use AdRequest.Builder.addTestDevice("*********************************************") to get test ads on this device.
    10-22 22:25:17.011 21342-21342/? W/Ads: #004 The webview is destroyed. Ignoring action.
    10-22 22:25:17.011 21342-21342/? W/Ads: #004 The webview is destroyed. Ignoring action.
    10-22 22:25:17.016 21342-21342/? W/Ads: #004 The webview is destroyed. Ignoring action.
    10-22 22:25:17.016 21342-21342/? W/Ads: #004 The webview is destroyed. Ignoring action.
    10-22 22:25:17.019 21342-21342/? W/Ads: #004 The webview is destroyed. Ignoring action.
    10-22 22:25:17.019 21342-21342/? W/Ads: #004 The webview is destroyed. Ignoring action.
    10-22 22:25:17.042 4130-21833/? W/Ads: App does not have the required permissions to get location
    10-22 22:25:17.343 4130-22008/? I/Ads: SDK version: afma-sdk-a-v18479999.12451000.1
  • olegoleg Member
    edited October 2019 Accepted Answer
    I can tell how everything is set up for me:
    Plugins: Gaming 16.0.0 + Admob 16.0.0

    Advertising class:
    require "ads"
    ads = Ads.new("admob")
    ads:setKey("ca-app-pub1")
    ads:enableTesting()
    interstitial @ |ads:showAd("interstitial","ca-app-pub-04")|  --  interstitial  --"smart_banner" banner
     
     
     
     shape = Shape.new()
    stage:addChild(shape)
     
    local text = TextField.new(nil, "Ad goes here")
    text:setScale(3)
    text:setTextColor(0xffffff)
    text:setPosition(50, 35)
    shape:addChild(text)
    ----
    local  width=application:getContentWidth()
    	shape:setFillStyle(Shape.SOLID, 0xff0000)
    	shape:beginPath()
    	shape:moveTo(0,0)
    	shape:lineTo(0,40+3)
    	shape:lineTo(width,40+3)
    	shape:lineTo(width,0)
    	shape:closePath()
    	shape:endPath()
    	shape:setPosition(minX, maxY-40-3)
    -------------------------------------------
    --ПОКАЗ БАННЕРА
    -------------------------------------------
    ads:addEventListener(Event.AD_RECEIVED, function(e)
    	adsoff=nil
    	print("ads AD_RECEIVED" , e.type  )
     
    	--[[
    	Timer.delayedCall(100, function()
    		local tween = GTween.new(ads, 1, {x = x, y = y+3}, {ease = easing.outBack, dispatchEvents = true})
    		tween:addEventListener("complete", function()
    			--кінець анімації
    		end)
    	end)]]
    end)
     
    ads:addEventListener(Event.AD_FAILED, function(e)
    	print("ads AD_FAILED", e.error)
     
    end)
     
    ads:addEventListener(Event.AD_ACTION_BEGIN, function()
    	print("ads AD_ACTION_BEGIN")
    end)
     
    ads:addEventListener(Event.AD_ACTION_END, function()
    	print("ads AD_ACTION_END")
    end)
     
    ads:addEventListener(Event.AD_DISMISSED, function()
    	print("ads AD_DISMISSED")
    	adsoff=true
    end)
     
    ads:addEventListener(Event.AD_ERROR, function(e)
    	--print("ads AD_ERROR", e.error)
    end)
     
    ads:addEventListener(Event.AD_DISPLAYED  , function(e)
    	print("ads AD_DISPLAYED  ", e.type  )
     
    local width = ads:getWidth() --ширина реклами
    	local height = ads:getHeight() --висота рекласми
    --	print(height)
    	local x = minX
    	local y = maxY-height-3
     
    	--перемальовка фігури
    	shape:clear()
    	shape:setFillStyle(Shape.SOLID, 0xff0000)
    	shape:beginPath()
    	shape:moveTo(0,0)
    	shape:lineTo(0,height+3)
    	shape:lineTo(width,height+3)
    	shape:lineTo(width,0)
    	shape:closePath()
    	shape:endPath()
    	------------------------
    	shape:setPosition(x, y)
    	Timer.delayedCall(100, function()
    		local tween = GTween.new(ads, 1, {x = x, y = y+3}, {ease = easing.outBack, dispatchEvents = true})
    		tween:addEventListener("complete", function()
    			--кінець анімації
    		end)
    	end)
    end)


    Ad serving:
    ads:showAd("interstitial","ca-app-pub-5801304")
    --stage:addChild(shape)
    --ads:showAd("smart_banner","ca-app-pub-5") 
    --ads:setPosition(minX,maxY+100)
    my games:
    https://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
    +1 -1 (+3 / -0 )Share on Facebook
  • thanks a lot Oleg

    I introduced set key wrong (with test ads), the error was because of that.

    Ads not showed anymore because I was loading ads anytime i want to show an ad, but ad already loaded, so i just have to put showad.

    Thanks again :)

    Likes: oleg, MoKaLux

    +1 -1 (+2 / -0 )Share on Facebook
Sign In or Register to comment.