How to implement isLoaded for Admob

Hi,

How do I implement isLoaded for admob ads.

Does corona ads plugin support admob isLoaded()/isReady() function call?

Thanks.

I am using latest  build #2381,

and I found ads.isLoaded(“interstitial”) always return false.

I have called ads.load(“interstitial”, { appId=[theId] } ) 

Besides, the interstitial ad actually shows up even isLoaded() returns false.

I am fine about not checking isLoaded(), however I am just wondering why it always returns false?

anybody sheds some light?

for Android device, it will return true.

the same code tested in iOS device, it always returns false! 

Having the same problem. 

If I call this function, let’s say during some downtime like a menu or on app start:

[lua]

function interstitials:loadAd()

    

    ads:setCurrentProvider( “admob” )   --is this neccessary? Not mentioned in docs…

    ads.load( “interstitial”, { appId= “my iOS interstitial ID from admob”, testMode = false })  

    

end

[/lua]

Then this to show the ad (at end of game, say):

[lua]

function interstitials:call()

    

     ads.hide()     --in case anything else is still showing

     ads:setCurrentProvider( “admob” )

     if ads.isLoaded(“interstitial”) == true  then

     

              ads.show( “interstitial”, { appID = “my iOS interstitial ID from admob”, testMode = false } )  --testmode not working in IOS

     

     end

    

end

[/lua]

ads.isLoaded(“interstitial”) is always false, and the interstitial doesn’t show. 

If I remove the check and the pre-loading, ads.show works-  but there is too long a wait for the ad to download. 

I’ve quadruple checked the build settings (and since ads.show works without the check, I’ll assume everything else

is ok, including the appID). 

Is ads.load / ads.isLoaded  working for anyone? Perhaps I’m doing something wrong with the ads.load ?

Admob seems to be the only viable option for interstitial style ads, as from what I can tell, Revmob has gone completely flakey and iAds only works on the iPad. But it’s no good we have to load the ad at the same time we want to show it… then it pops up 20 seconds later when the user is already doing something else. 

Hi @roboward,

Can you please remove those “ads:setCurrentProvider( “admob” )” lines and report if there’s any change?

Thanks,

Brent

Corona build 2014.2393

I haven’t noticed any issues on iOS. I use ads.isLoaded() without a problem. (I use ads:setCurrentProvider(“admob”) first since I use Vungle which also uses the ads API)

There are a few differences in my implementation though.

  1. I don’t call ads.hide() before showing the interstitial. It’s unnecessary.

  2. I don’t specify the appID in ads.show()/ads.load(). 

My call looks like this ads.load / ads.show(“interstitial”, {testMode=TEST_MODE}) 

TEST_MODE is a variable that I can set to activate/deactivate test mode

Also, testMode works for me when set to true. I get test ads.

Chartboost and Vungle are also good networks to consider.

My case is that interstitial ads always show but my question is why

ads.isLoad() always returns FALSE for iOS devices ?

(However, with exactly the same code, Android devices return TRUE)

Thanks Brent and Ingmar:

* removed “ads:setCurrentProvider( “admob” )” (all else the same) ----- no change- ads.isLoaded(“interstitial”) = false

* removed ads.hide(), and removed the “appID =” business from ads.load/ ads.show —no change- ads.isLoaded(“interstitial”) = false

Will very likely be using Vungle, but as video ads in another spot- so will also likely be needing the ads:setCurrentProvider

Joe528- I suspect we’re having the same problem. Admob ads show for me fine, but I want to only show them if ads.isLoad == true, which it never is. If it’s working for you on Android but not IOS… then maybe it’s related somehow to the note in the docs that states test mode is working on android but not on IOS. 

Joe528- I suspect we’re having the same problem. Admob ads show for me fine, but I want to only show them if ads.isLoad == true, which it never is. If it’s working for you on Android but not IOS… then maybe it’s related somehow to the note in the docs that states test mode is working on android but not on IOS. 

I am not using test mode at all. 

Vungle is video, sometimes you don’t want to interrupt users for such a long time during scene transition.

Charboost was something I wanted to try, but I saw the plugin was not maintained any more besides the most serious problem is this: 

As of Corona version 2169, the Corona Lua API no longer has access to an iOS device's IFA. As a result the Chartboost Plugin will not function correctly when built for iOS from these versions, and should therefore be considered incompatible for these cases. Until access to the IFA is restored, iOS developers should only build with versions of Corona prior to 2169.

I think adMob still the one most people use and I hope to see more stability in it.

You can get a native Chartboost plugin for Corona here:

http://gremlininteractive.com/product/chartboost-plugin-for-the-corona-sdk

I use it for both Android and iOS, and it works very well.

Admob Test ads work just fine on iOS.

What about the callback? Do you get a callback after calling ads.load(“interstitial”)?

I get the following callback.

event.name=“adsRequest”

event.isError=false

event.response=“The ad loaded successfully”

…and as said above, I get a test ads as soon as I specify {testMode=true}

Also ads.isLoaded(“interstitial”) always returns true for me as long as the callback above was successful.

Corona build 2014.2393

The only other thing is that I’m using Enterprise, so I compile with Xcode locally, but I don’t think that should make a difference.

For me it takes about 3-5 seconds for the Admob callback to get called after a call to ads.load()

Sometimes the callback response is something like “No fill” (don’t remember exactly), but it rarely happens with Admob.

Thanks Ingemar-

(Also using Corona build 2014.2393,  testing iPhone 4 iOS 6)

I get the same callbacks:

event.name=“adsRequest”

event.isError=false

event.response=“The ad loaded successfully”

 

But still get ads.isLoaded(“interstitial”) = false. 

 

If I just pop the ads.show in the listener under "if event.phase == “loaded”, then the ad does load

(after a delay, of course).  So next I’ll try putting something like admobLoaded = true there in the

listener, and check that flag when it comes time to actually show the ad. 

 

Trying to do the preload check without using ads.isLoaded-  no idea why that’s not working here. 

The question is why ads.isLoaded always return FALSE for iOS devices even after the callback indicates the preload is successful?

It’s exactly the same as the original question I was asking.

The question is why ads.isLoaded always return FALSE for iOS devices …

The question is why does ads.isLoaded(“interstitial”) always return TRUE for me on iOS devices (iOS6/7/8) when an ad is cached?

One thing I’m wondering about. Are you guys using new or legacy Admob ad-unit ID’s?

The new one’s are formatted like “ca-app-pub-xxxxxxxxxxxxxx/yyyyyyyyy” whereas the old ones are formatted like “axxxxxxxxxxxxxx”.

I’d suspect that the old ones might cause unexpected behavior as they were made obsolete on Aug 1.

It’s weird. For my projects ads.isLoaded() returns true/false perfectly for Admob in every test case.

Already using new admob ID.

Do you have multiple ad providers using together? Or just admob only? My only guess is this. Or I don’t know why you can see ads.isLoaded() returns TRUE for iOS devices while two of us see it always FALSE.

I use Vungle, Admob and Chartboost. 

Vungle and Admob use Corona’s ads.* API.

For Chartboost I use Gremlin Interactive’s Corona plugin.

I’ve also written my own ad-mediation module which switches between the ad networks automatically, plus I can configure the ad networks (ad frequency / network order) on-the-fly with a server based configuration as needed without having to re-submit the app for approval.

Maybe my module logic somehow circumvents the problems you’re experiencing…

The only other difference is that I’m using Enterprise which means I’m using Xcode to build the app bundle locally.

Well, I’m not asking a new question- simply trying the helpful suggestions by Brent and Ingemar and reporting back the results. That’s how we *might* figure out what’s going on in our case. 

Ingemar- I’m doing something similar for banners… loading a .json file from a server to determine the frequency for each ad provider.

Not for non-video Interstitials yet though, as I don’t even have Admob working. 

I’ll keep poking away at it to either make it work, or perhaps have something definite to report to Corona that could be fixed. 

And thanks- any more suggestions for things to try would be appreciated.

I am using latest  build #2381,

and I found ads.isLoaded(“interstitial”) always return false.

I have called ads.load(“interstitial”, { appId=[theId] } ) 

Besides, the interstitial ad actually shows up even isLoaded() returns false.

I am fine about not checking isLoaded(), however I am just wondering why it always returns false?

anybody sheds some light?