CoronaLabs please look - Prevent AdMob Interstitial to fire mid game

Have another question:

If both banner and interstitial are being implemented in admob in the same app, should init be called twice, once for each type of banner?

I’m trying to implement ads.isLoaded() and ads.load() but on Colona Simulator I see a following error: “attempt to call field load (a nil value)”.

On Android device this seems don’t work also.

Tested it with latest daily build (2339), and with "“CoronaProvider.gameNetwork.google” plugin set in the build.settings file.

It sounds to me like you’re trying to load the Google Play Game Services plugin, not the AdMob V2 plugin which is known as Google Play Services.  A subtle but important difference.  See:

http://docs.coronalabs.com/plugin/ads-admob-v2/index.html

and make sure you’re grabbing the plugin code from that page.

Rob

My build settings seems to be good:

plugins =

{

[“plugin.google.play.services”] =

{

publisherId = “com.coronalabs”,

},

},

My code:

local ads = require "ads"; local idAdmobIn="xxxxx"; local function adListener( event ) local msg = event.response if event.isError then print("errInt: "..msg) end end ads.init( "admob",idAdmobIn, adListener ) function adMob(mode) if mode==1 then ads.load("interstitial", { appId = idAdmobIn}) elseif ads.isLoaded("interstitial") then ads.show( "interstitial", { x=0, y=0, appId = idAdmobIn } ) end end

Checked it on Windows and MacOS , and results are the same (“attempt to call field load (a nil value)”)

What happens if you try it on a device?

Rob

Null value error is displayed only on simulator (on both ads.load/isLoaded invokes).

On Android device interstitials are displayed correctly, though after my tests, I see that only first Interstitial is showed immediately after button click, but next Interstitials are displayed with few second delays… I see that isLoaded is always TRUE after first Interstitial load (then load is’t  more invoked)…

This has been fixed. Load function now accepts the testMode parameter

According the the documentation load() supports testMode, however in reality (on iOS) a live Interstitial is shown when show() is called.

I’m not sure about Android as I haven’t tested it yet.

I have just finished another app using the original admob plugin and switches between banner and interstitial whenever I want, just using the orginal fIx using two ids and hide, hide then show and works every time.

When you say “original admob plugin”, do you mean Admob V1 or V2?

Just the first one. Never knew it to be called V1. But I guess you could call it that.

Yeah, V1 was my name for it  :).

The only issue I have with that version is that Google will stop serving ads to it after Aug 31st this year. 

Although must add it did crash first time on android but restarted and fine, might have been a caching issue.

Really… . I didn’t know that! News to me!..oh well. well by then I can do a quick update I guess on any popular apps if any by then.

Here’s a link that explains a bit more.

http://www.googblogs.com/legacy-admob-sunset-and-legacy-sdk-deprecation-reminder/

Nice one. Cheers! I always thought it meant just control panel which I upgraded a while ago. Missed the bit about the sdk. Just when I had my ad functions working perfectly. …

I know…

Sometimes it feels like there’s always somebody who likes to throw a wrench in the works  :wink: .

I can confirm this error in 2340 in the Mac Simulator. 
Works in my Android device though…

I’m not sure how well AdMob is supposed to work on the simulator, in particular with V2 which requires Google Play to do its thing on Android.

Rob

will this V2 only work on Android? It’s been quite handy working on IOS too