AdmobView on, off, then... On again?

Monkey Targets Forums/Android/AdmobView on, off, then... On again?

Dabz(Posted 2014) [#1]
Basically, I'm using Diddy too... In my title screen, I have this in Start:-

myadmob=Admob.GetAdmob()
myadmob.ShowAdView 3,1


myadmob is a global... In Update of the title screen, when the user taps the screen, I have this:-

myadmob.HideAdView
diddyGame.screenFade.Start(50, True)
diddyGame.nextScreen = gameScreen


Okay, player plays the game, no intrusive ads, so, when its game over, I have this:-

If gameStatus = GAME_OVER
	mouseButtonState.Update()
	If mouseButtonState.left = True 
		myadmob.ShowAdView 3,1
		diddyGame.screenFade.Start(50, True)
		diddyGame.nextScreen = titleScreen
	Endif
EndIf


Which, then, when the game gets back to the titleScreen, you should see ads... Yeah... Well, no... Because the buggers arent coming back! :/

Any ideas?

Dabz


Dabz(Posted 2014) [#2]
I've also tested the admob example code... Does exactly the same, once they have gone, they've gone...

Dabz


therevills(Posted 2014) [#3]
Every time you call ShowAdView, Monkey goes away and gets a new one, so if you call it multiple times per loop it will always be getting a new one.

Also you said you've got myadmob=Admob.GetAdmob() in the Start method... I think you should only get It once per application.

Here are snippets from Pirate TriPeaks:

#ADMOB_PUBLISHER_ID="ca-app-pub-xxxxxxxxxxxxxxxxxxxxxxxxxx"
...
Class MyGame Extends DiddyApp
#If TARGET="android"
	Field admobBanner:Admob
#end
	Method Create:Void()
...
#If TARGET="android"
		admobBanner = Admob.GetAdmob()
		admobBanner.ShowAdView(1, 2)
#end
...
	End
...
Class TitleScreen Extends Screen
..
	Method Start:Void()
#If TARGET="android"
		If Not game.disableAds Then
			game.admobBanner.HideAdView()
		End
#end
..
End
...
Class GameScreen Extends Screen
...
	Method Start:Void()
		If Not game.disableAds Then
			#If TARGET="android"
				game.admobBanner.ShowAdView(1, 3)
			#end
		End


End



So in that game, I disable the Ads when displaying the titlescreen and display them in game...


Dabz(Posted 2014) [#4]
Cheers Steve... Appreciate that matey! ;)

Dabz


Dabz(Posted 2014) [#5]
Works now... Wahoo... Honestly, I thought I was going mental! :D

Dabz


rIKmAN(Posted 2014) [#6]
I had the "always calling a new ad" problem at first too :)

It works now, but I get a message in the console from Google telling me to update to the new SDK which I thought might have been the problem to start with. Do you know if Monkey works with the new one?

Got any tips for AdMob setup, networks, settings etc?