Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

CoronaLabs please look - Prevent AdMob Interstitial to fire mid game
Started by fortress Mar 06 2014 05:18 AM

40 replies to this topic
[TOPIC CONTROLS]
Page 1 of 2 1 2
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

fortress

[GLOBAL: userInfoPane.html]
fortress
  • Observer

  • 8 posts
  • Corona SDK

ADMOB - AND ANY AD INTERSTITIAL FOR THAT MATTER -SHOWS AT RANDOM TIMES, EVEN IF I CALL ADS.HIDE() AND EVEN IF I CALL ADS.HIDE() IN EVENT.ISERROR IN CASE IT GETS FIRED MID-GAME!

 

I'm having a problem where admob and other interstitials get displayed at the wrong times - in the middle of the game action and not after scene is complete, like they should have.

 

-> I also call ads.hide() upon entering the scene, but it does nothing and the interstitials are still being fired mid game.. <-

 

 

I strongly believe there should be two functions:

 

ads.load()       and only then

ads.show()

 

----->>  so we can check if the ads actually loaded/have been received/are ready   before trying to show them

 

- also, ads.hide() in case of banner ads, in my opinion, should only hide the banner and not destroy it, as I noticed the banners get delayed too if you hide and show them often ( basically recreate them all the time - that can breach advertising policies as well! )

- this would again require two functions ads.hide() and ads.end();  or something like that

 

I added a listener in ads.init to check for event.isError, 

but that's already too late as - correct me if I'm wrong - it only catches the error if the ad could not be SHOWN.

 
I did try to fix the problem by calling ads.hide() if event.isError gets triggered in ads.init() by ads.show(), but it does nothing and ad still shoots up and stays there...
 

--- >> THE PROBLEM IS THAT interstitial ads aren't received at the right time, SPECIALLY ON SLOW MOBILE CONNECTIONS, and when they do get in cache later, they then just fire at will... even if I call ads.hide()

- Now when I'm programming in Objective C, I use admob's delegate callback methods to check if the interstitial ad has been received, set a flag and then check that flag before showing the ad, i also check if game is paused before presenting the ad.

That's why it's essential to first call   -   a load function   -  to know if the ad is even available to be shown... AND NOT TO SHOW THE AD AT THE INAPPROPRIATE TIMES!

 

 

Please kindly respond

Thank you



[TOPIC: post.html]
#2

fortress

[GLOBAL: userInfoPane.html]
fortress
  • Observer

  • 8 posts
  • Corona SDK

[TOPIC: post.html]
#3

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,697 posts
  • Enterprise

Please file a bug report.   You will need a project that shows the problem complete with the build.settings and config.lua that you are using.  Every time we bring issues like this up with Engineering they ask where is the bug report and they want to see code that's failing.  It's very inefficient on their time to have to try and re-create these issues.

 

Thanks

Rob



[TOPIC: post.html]
#4

Rob...

[GLOBAL: userInfoPane.html]
Rob...
  • Contributor

  • 334 posts
  • Corona SDK

I had same problem then realised i had it triggered with system resume. It seems when you close the full screen ad, it goes into resume mode. Not saying this will fix your problem but worth looking at as mine now works.



[TOPIC: post.html]
#5

ingemar

[GLOBAL: userInfoPane.html]
ingemar
  • Corona Geek

  • 2,733 posts
  • Enterprise

The listener is also called when an ad is shown (isError=false in this case).

Did you try adding a "canShowAds = true/false" flag and just calling ads.hide() in the listener if canShowAds=false and isError=false?

 

I do agree though that an ads.load() function would be nice.



[TOPIC: post.html]
#6

davebollinger

[GLOBAL: userInfoPane.html]
davebollinger
  • Corona Geek

  • 1,373 posts
  • Corona SDK

fwiw: most of the "nicer" third-party ad libraries, including revmob and chartboost, have this sort of functionality - that is, there are "load/precache/create" -type methods that you can call in advance of "show". and typically there are corresponding "destroy/release" -type methods apart from "hide".

as implemented in the ads library, i think only Vungle "sort of" supports something similar by at least immediately returning false from show() if cache isn't already available (probably because since it's video, that behavior is essentially required -- it'd be entirely unusable if it behaved as other plugins where show() *starts* the download, cuz user would wait forever til megs of video buffer filled enough to actually start playing)

I've seen admob take nearly a minute (on a strong wifi connection) to actually show up after calling show(). No idea why, just happens. Meanwhile, player has potentially advanced well-beyond where that banner was appropriate, may even be on an end-game interstitial from some OTHER provider!, and along comes admob just popping up whenever/wherever it wants. :D As ingemar notes, you can try "global" flags in the listener, and hide immediately upon show, but that can get tricky if you're not careful, and you won't (typically? maybe just android? fact-check me, ymmv) get the event timely enough to prevent at least a brief display.

[TOPIC: post.html]
#7

Netox

[GLOBAL: userInfoPane.html]
Netox
  • Enthusiast

  • 75 posts
  • Corona SDK

legacy AdMob library has interstitial.isLoaded() function.

In my Corona games interstitial adMobs ads are called before the game but showed during the gameplay when user already playing which is totally ridiculous... but we can't control it in our beloved Corona....



[TOPIC: post.html]
#8

Rob...

[GLOBAL: userInfoPane.html]
Rob...
  • Contributor

  • 334 posts
  • Corona SDK

Actually upon further testing. The full screen ads come up  randomly in game time. The refresh must be firing  off even with hide turned on. Its currently useless! Edit possibly its really delayed in coming  up so if it doesnt come up when its supposed to it still comes up during play later on. Im just removing it and  keep just a banner for now.



[TOPIC: post.html]
#9

fortress

[GLOBAL: userInfoPane.html]
fortress
  • Observer

  • 8 posts
  • Corona SDK

Thank you guys for keeping the topic going!

 

Ingemar, thank you I have tried that before, yet with no results, like others have noticed, there is something wrong with ads.show() and no matter what i do, nothing seems to prevent the ads from fireing whenever they please... 

 

Even if we did get it working, that would still mean that only less than 10% of the time the ads would actually show when theyre supposed to, which would render them useless...

 

An ads.load() method is essential!!

 

 

There is a feature request here, so please vote to implement it:

http://feedback.coronalabs.com/forums/188732-corona-sdk-feature-requests-feedback/suggestions/5222567-preloading-ad-banner-interstitial-before-showing-i

 

 

Also please as many of you as you can, post a BUG REPORT WITH SOURCE TO REPRODUCE THIS PROBLEM, the more of us there are, the more seriously they'll take it, and move its importance up before other not so important issues (I'd say monetisation is #1 priority to keep us afloat and producing quality content! 

 

They have to revamp the adMob ads code anyhow in the next few months to comply with Googles Play Store policies, so I'd say this is the PERFECT TIME TO FIX THIS ISSUE AS WELL.

 

Please post your findings and support and keep the topic going.

 

Thank you :)



[TOPIC: post.html]
#10

MAS1

[GLOBAL: userInfoPane.html]
MAS1
  • Contributor

  • 279 posts
  • Corona SDK

Oh boy, what a mess this AdMob interstital is.

 

In event.type == "applicationResume" I call ads.show("interstitial", {...})

 

Once you've ask for it - YOU ARE GONNA GET IT ! :rolleyes:   - no matter what.

 

It matters not what flags you set and when or how often you call ads.hide() ... it's like a sputtering missile. You can't take it out (BANG!) and you don't know when it's gonna hit (KABOOM!)

 

@Ingemar - tried your idea in the ad listener. Nada. Not even the nuclear (continuing with the missile analogy!) option:

 

timer.performWithDelay(0, function() ads.hide() end, 0)

 

Corona subscription up next month. Delayed Admob banners on Android, no image attachment on Twitter for Android (so, basically no usable social media plugin on Android that I have paid for) and now this PITA.

 

To renew or not to renew - that is the question! :D



[TOPIC: post.html]
#11

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,697 posts
  • Enterprise

Is there a bug report number for this interstitial issue?



[TOPIC: post.html]
#12

fortress

[GLOBAL: userInfoPane.html]
fortress
  • Observer

  • 8 posts
  • Corona SDK

I submitted one, but can't remember it's number - still, NOTHING HAPPENED!

 

 

Could you pass this on to that department please?

 

 

It's a HUGE ISSUE, as I was developing a game, with a gameplay that it's only source of revenue could be achieved with interstitials and nothing else, due to it's design, and i've had to put it on hold until I can actually make it work like that, due to this issue..

 

 

As the poster above said, this also made me question buying a paid license, if I can't make a game that could monetise..

 

 

Again please, do notify the bugs / new features department, otherwise nothing will get done...

 

 

 

Thank you



[TOPIC: post.html]
#13

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,697 posts
  • Enterprise

You should have gotten an email with the bug number in it.  I really can't go to engineering with out one.

 

Rob



[TOPIC: post.html]
#14

dchan

[GLOBAL: userInfoPane.html]
dchan
  • Contributor

  • 360 posts
  • Corona Staff

[TOPIC: post.html]
#15

ingemar

[GLOBAL: userInfoPane.html]
ingemar
  • Corona Geek

  • 2,733 posts
  • Enterprise

excellent !  :D



[TOPIC: post.html]
#16

davebollinger

[GLOBAL: userInfoPane.html]
davebollinger
  • Corona Geek

  • 1,373 posts
  • Corona SDK

awesome! :)

q:  does isLoaded() automatically reset after a show()?



[TOPIC: post.html]
#17

MAS1

[GLOBAL: userInfoPane.html]
MAS1
  • Contributor

  • 279 posts
  • Corona SDK

Glad I renewed!

 

Keep up the good work!



[TOPIC: post.html]
#18

fortress

[GLOBAL: userInfoPane.html]
fortress
  • Observer

  • 8 posts
  • Corona SDK

Ahh, Great news at last!

 

 

Thank you   dchan  and anyone who helped making this feature implementation and bug fix a reality!

 

  :)



[TOPIC: post.html]
#19

Rob...

[GLOBAL: userInfoPane.html]
Rob...
  • Contributor

  • 334 posts
  • Corona SDK

I just finished an app using current admob plugin and managed to switch between interstitial and banner when I wanted.

[TOPIC: post.html]
#20

fstudios

[GLOBAL: userInfoPane.html]
fstudios
  • Observer

  • 12 posts
  • Enterprise

Hi,

 

Unfortunately the load() function doesn't seem to support the testMode parameter. This is causing actual ads to be shown when testing or debugging. Can you please include support for the testMode parameter passed to the load() function?

 

Thanks!



[TOPIC: post.html]
#21

fstudios

[GLOBAL: userInfoPane.html]
fstudios
  • Observer

  • 12 posts
  • Enterprise

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?



[TOPIC: post.html]
#22

Netox

[GLOBAL: userInfoPane.html]
Netox
  • Enthusiast

  • 75 posts
  • Corona SDK

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.



[TOPIC: post.html]
#23

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,697 posts
  • Enterprise

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



[TOPIC: post.html]
#24

Netox

[GLOBAL: userInfoPane.html]
Netox
  • Enthusiast

  • 75 posts
  • Corona SDK

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)")



[TOPIC: post.html]
#25

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,697 posts
  • Enterprise

What happens if you try it on a device?

 

Rob




[topic_controls]
Page 1 of 2 1 2
 
[/topic_controls]