Admob on iOS - isLoaded() always returning 'false' unless Provisioning Profile is changed

You can email support@coronalabs.com with your .zip file if you’re unwilling to post it publicly, but before you do we don’t have time to debug your project. If you want to submit a bug report, build a very minimal sample app that has your AdMob code in it so we are not having to dig through your entire projects looking for things.

If it’s working with some provisioning profiles but not others, then your provisioning profile is suspect. That is a combination of your certificate, and you bundle ID (if it’s a development profile, your valid test devices).  Since we cannot use your provisioning profile, and if we go on AdMob, create a new app and test it against test ads (which is the best we can do) then we’ve not determined anything.

Your and our time would be better served if you put some print statements dumping the event table so we can see if AdMob is tell you something when you try to call .init() .load(), .show() etc.  These are all basic debugging things that you’ve not shared with us if you have done them before we can go chasing it as a bug…

Rob

Okay, thanks. The problem starts at ‘init’ as I already shared in the second post, the event.phase returns ‘failed’. The last line in post 3’s debug shows the event.phase result.

The debug I posted afterward shows ‘Returning empty document’ from DocumentLoader although I’m not sure if that’s related. I can’t determine anything else from the output.

I don’t think it’s worth posting a sample project to Support, I don’t think anyone will have time to look at it. I’ll try to figure it out on my own, although I’ve wasted a few days on this and I’ve been doing the same things I’ve always done for years. I’ll see what I can do. It’s a bummer since I paid Corona for the plugin renewal just to release this app.

If anyone else has the same issue, please let me know.

At the top of your admob listener function do this:

location function adListener( event) -- or whatever you call it     print("------------ AdMob listener ------------")    print("event.isError:", event.isError)     print("event.name:", event.name)     print("event.phase:", event.phase)     print("event.provider:", event.provider)     print("event.response:", event.response)     print("event.type:", event.type)     print("event.data:", event.data)     print("------------ AdMob listener ------------")

This will give you all the information AdMob is returning. Please share this information.

We want to help you.  You’ve been a customer for quite a while and we appreciate it, but as I said, if it’s an issue with a provisioning profile, which you feel it is, it is physically impossible for us to reproduce the problem because we can’t build against your developer account and profiles.  

What I can do is encourage Engineering to update the iOS AdMob plugin to the latest version if we are not there already. Google has been doing some weird things on the Android side with regards to problems that seem backend related and some problems have mysteriously fixed themselves. 

Rob

Hi Rob,

Thanks for the helpful debug tip.  Sorry for the late response as I was away.

Here’s some console output I gathered after the first ads ‘init’ followed by the ‘load’ of a banner:

https://pastebin.com/embed_js/9AcxKisA

In summary,

This is what happens on init -

In my code I had used:    g.ads.init(g.adListener, {appId = g.appId, testMode = g.testMode})

[Device] ------------ AdMob listener ------------ [Device] event.isError: false [Device] event.name: adsRequest [Device] event.phase: init [Device] event.provider: admob [Device] event.response: nil [Device] event.type: nil [Device] event.data: nil [Device] ------------ AdMob listener ------------

And if you scroll further down, you will see this when it tries to load a banner -

In my code I had used:  M.ads.load(“banner”, {adUnitId = M.adUnitId[“banner”], hasUserConsent = false})

[Device] ------------ AdMob listener ------------ [Device] event.isError: true [Device] event.name: adsRequest [Device] event.phase: failed [Device] event.provider: admob [Device] event.response: loadFailed [Device] event.type: banner [Device] event.data: {"errorCode":1,"adUnitId":"ca-app-pub-2717177285541669\134/9951144852","errorMsg":"Request Error: No ad to show."} [Device] ------------ AdMob listener ------------

AdMob has no ads to show you.

event.data: {“errorCode”:1,“adUnitId”:“ca-app-pub-2717177285541669\134/9951144852”,“errorMsg”:“Request Error: No ad to show.”}

What country are you in?

What is the value of g.testMode?

We are not experts at using AdMob. Since you say the provisioning profile is effecting this, it make sense that either a) something isn’t right with your provisioning profile or b) Google is trying to figure out information about the app by finding it in the App Store (maybe it’s using Apple’s App ID which is like a 10 digit # that’s part of the app’s URL) and they are sending ads to one that they found, but not to one they haven’t found.

I doubt this is a unique to Corona issue and other developers may be experiencing it. Have you conducted an internet search to see what others are saying on StackOverflow or the Apple Developer’s forums about it?

Rob

Hi Rob,

I apologize once again for my late reply! I was away on vacation for 2 weeks and couldn’t find the time to use my computer.

To answer your question, in the code above, I had been using non-testMode when trying to test the AdMob ads (when I enabled test mode it did show interstitial ads though).   But anyways, it looks like I have solved the problem for non-test mode!  It was a settings issue with the ad units on my AdMob account -

In the apps.admob.com site, under my Ad unit settings, for my interstitial ad, under Advanced Settings it had asked for “Ad type”.  Under this category I had initially enabled “Text, image and rich media” ads, but had unchecked “Video” ads.  BUT… Once I checked the “Video” box, all of a sudden the interstitial AND the banner ads started appearing.

I’m not sure why my other apps didn’t exhibit this issue.  It seems to work now though, so I will continue to monitor it, and also make sure all my other apps’ ad units have the same ‘Video’ option enabled.  I had disabled Video ads all this time for all my apps due to their annoyance.  But I guess I’ll run them anyway just to be sure.  Really weird.

Okay, one day later and the ads are not showing again ;-/

I’ll try or debug it more later. This is really baffling.