admob-v2 plugin - test results

Simulator cannot test advertising. But it’s not required or documented that we have to put some conditional check to see if Simulator is running, if so, don’t call ads related function because it will crash. 

Corona should come up and say something about its plan about V2 bugs & documentation.

I agree that it should fail gracefully. It shouldn’t crash…

I haven’t had any other ad or other plugin crash the simulator.  I use a bunch of plugins, many of which don’t have any effect on the simulator, but none of them crash it.  That fact alone leaves me wondering if the admob V2 plugin wasn’t given the normal test treatment at CL before being released.  I don’t really understand the difference in the way plugins are implemented re: Pro vs Enterprise, but it does seem like us Pro users are the ones with the problems with this particular plugin.

As far as I know there shouldn’t be any differences between Enterprise and Pro. We both use the same plugin binaries.

The only difference is that Enterprise projects are built locally whereas Pro projects get built on CL’s servers.

I am having similiar results (on Android simulator crashes as on iOS).

Also, when switched to Admob v2 (even without using ads.load/isLoaded), my app crashes (tested on Android device), when I try to post to Facebook - app becomes unresponsible, after change to Admob v1, I can post to Facebook without problems. 

iOS: ads.load() does not crash in Simulator or on my device, i just can’t seem to display any Admob interstitials with the V2 plugin (no problem with banners). Using similar codes, Admob V1 no problems with banners or interstitials. 

I do get this in the xcode console: <Warning>: <Google:HTML> Google Mobile Ads SDK: You are currently using 6.8.0 of the SDK. A new version, 6.9.2, is available 

  1. Create some sample code of your issues and submit it as a bug.

  2. Post bug number.

I submitted a bug, # 33780. Here is the simple code sample I submitted that crashes for me on the simulator.  I’m a Pro user using daily 2347 on a Mac.  The error message is “…attempt to call field ‘load’ (a nil value)”

main.lua:

-- Test admob crash on simulator local ads = require "ads" adUnitID = "ca-app-pub-1111111111111111111111111111" local function admobListener(event) for k,v in pairs(event) do print("admob event k,v: ",k,v) end end ads.init( "admob", adUnitID , admobListener ) ads.load("interstitial", { appId = adUnitID, testMode = false })

And build.settings:

-- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight settings = { &nbsp; &nbsp;plugins =&nbsp; &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp;["plugin.google.play.services"] = { publisherId = "com.coronalabs",}, -- For Admob plugin }, orientation = { default = "portrait", supported = { "portrait", } }, iphone = { plist = { UIStatusBarHidden = false, UIPrerenderedIcon = true, -- set to false for "shine" overlay --UIApplicationExitsOnSuspend = true, -- uncomment to quit app on suspend &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; --[[&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -- iOS app URL schemes: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CFBundleURLTypes = &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CFBundleURLSchemes = &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "fbXXXXXXXXXXXXXX", -- example scheme for facebook &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "coronasdkapp", -- example second scheme &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; --]] } }, --[[-- Android permissions androidPermissions = { &nbsp; "android.permission.INTERNET", &nbsp; },]]-- }

Does this v2 version have anything that allows us to know when an Interstitial is closed so we can start the banners again?  I’m having problems with the v1 plugin not showing both at the same time.  I had it working, but now it isn’t anymore.  If I try to do both, (i relaunch banner after interstitial since it kills it) it just causes both to stop.  The banner being called right after interstitial breaks interstitial by aborting it before it shows and then banner never turns back on.

@dchan can you please bump up the priority on this?  Here is another thread opened today by someone else with the same crash with ads.load():

http://forums.coronalabs.com/topic/49113-admob-v2-crashing-on-adsload-really-strangeideas-please/

Wished i had searched the forums before upgrading.

Although when they say its working etc why would I ?

I only upgraded to pro for admobV2 !  I couldnt waut until the next public release and now it dosnt work…ridiculous.

I am considering asking for my money back ,it can be done on their 5 day policy.

Has a member of Corona spoken on the subject yet ?

This is very disappointing indeed

Ok , so I submitted a bug report but accidentley placed my ads.load() etc before my init…

Must remember to check after stripping everything out.

resubmitted.

However it seems to me that the engineers are not aware of this or rather some are not.

I appreciate them looking at the exact issue but surely common sense should have told them; oh hang on a minute this is that bug everyone in the forums talking about?

fingers crossed they come up with something.

And this should be fixed…

Ok,

I am feeling little bit overpowered here.

 I am just trying to get something sorted, although I am young I do feel very overpowered by Corona.

Tom has stated and i quote

"

I did run your sample with the correct placement of the code and it runs fine on a Nexus 7 so I don’t see the crash you’re talking about. It did correctly show an ad. We don’t have any other crash reports for Admob.

"

We don’t have any other crash reports for Admob" really? what about this thread ?

I am going to leave this for a while now, I just dont appreciate spending hundreds of dollars to have something not work when it is supposed too.

I have posted my code here if anyone wants to try it:

https://drive.google.com/file/d/0B9IPnsjHf9UEdllzSnNCckQ1dTQ/edit?usp=sharing

thanks

ps. i will bow down gracefully and apologise totally if I am wrong most sincerely.

ads.load() now works for me on iOS devices (though still busted on simulator).

For those experiencing a crash with ads.load() in the Simulator, you can use the following code.

The Corona Simulator library in missing a stub for the new load() function, which is why it’s crashing.

The following code is a workaround.

local ads = require("ads") ads.init("admob", "your-appID-here" [, optional\_listener]) ads.oldload = ads.load ads.load = function(...) if (type(ads.oldload) == "function") then ads.oldload(unpack(arg)) else local msg = "ads.load() not available" if (system.getInfo("environment") == "simulator") then print(msg.." in the Simulator") else print(msg) end end end

Weird.  Now it’s not working when I try to build for iOS.  I’m getting this “Unexpected build error” in my Sublime build console when I try to build for device:

/Users/stephenlewis/Desktop/BakeryBatch.app/.build/libtemplate/Builder.lua:310: <error>{“status”:256,“message”:“ld: library not found for -lads-admob\nclang: error: linker command failed with exit code 1 (use -v to see invocation)”}</error>

stack traceback:

C: in function ‘assert’

/Users/stephenlewis/Desktop/BakeryBatch.app/.build/libtemplate/Builder.lua:310: in function ‘checkError’

/Users/stephenlewis/Desktop/BakeryBatch.app/.build/libtemplate/Builder.lua:333: in function ‘build’

?: in function ‘buildExe’

?: in function <?:695>

EDIT:  CL fixed this.

I have asked so many times but no answer,

(1) Why do we need to call ads.load()?  (And I have to call it in system suspend event again in order to call ads.load consistently, what a weird implementation!) Android doesn’t need ads.load() to be called, why is the difference? And this method is brought by Corona users not from official document, why is it trustworthy?

(2) Where is the formal documentation?

(3) Why is there no more callbacks in the admob listener? (both successful or failure case, no more callback!)

Corona, could you answer these questions first? I really don’t care if ads.load() crashes in Simulator if these questions can not be answered first because I am really having doubt in using V2 and I strongly believe V2 has to be improved a lot!!! 

Android doesn’t need ads.load() to be called

Really? Where did you get that information?

From my previous testing that I didn’t call ads.load(), Android can show the full screen ad.

And I just tested it again, the same result, Android can play full-screen ad without calling ads.load()

I don’t know how you get to know the workaround by calling ads.load() for iOS devices to show full-screen ad. 

Why can’t Corona come up & answer these questions?

(1) Where is the formal documentation?

(2) Is ads.load() necessary for iOS? isn’t this just pre-load? Why is it necessary?

(3) In iOS, even I call ads.show() without ads.load, why is there no error (no callbacks)? It’s just plainly silent, which is also wrong!

(4) Even if ads.load() is called in iOS and the full-screen show successfully, why is there no more callback?

(5) Android can show the full-screen ad without ads.load & there is callback. Why does Android behave differently than iOS? 

(6) Why can Corona consistently avoid answering these questions?