Hello dev friends, I'm new, and I have a lot of questions, I have a project and I put all the libraries and the admob plugins but when I need to show the ad it does not appear in the center of the screen in each game over, I ' m working in eclipse and I'm using this code in my game:
@yaxxar I think you also need to call admob:showAd( adType ). adType can be set to the type of ad that you've pre-loaded. You also need to handle events coming back to your app from the ads interface. Use this reference to help you:
@ar2rsawseen@simwhi hello again, and thanks for the help, I added the code admob:showad("banner") but now is not found in the plugin I think because I look the plugin code but I didn t find the function showAd, thanks.
@yaxxar Make sure that the function calls are correctly capitalised. I also noticed that you are calling admob.removeAd(). I don't think that function exists. I haven't seen it documented anywhere. I use admob:hideAd("banner").
@simwhi hello, in the plugin code there is the function removeAd() and it wont crash or show any error on my app, I bet is something with showAd but I can t work right now in my game cause I'm on my another work ">
@simwhi thanks a lot, I m a total newbie in Gideros and game programming "> but with your help and of course with @ar2rsawseen, things turn very easy, thanks a lot I gonna try in the night
Comments
http://docs.giderosmobile.com/interface/ads
@ar2rsawseen Does loadAd() work for the admob plugin?
Here's a snippet of code from my project:
require('ads')
self.admob = Ads.new("admob")
self.admob:addEventListener(Event.AD_FAILED, self.onAdFailed, self)
self.admob:addEventListener(Event.AD_ERROR, self.onAdError, self )
self.admob:setKey( key )
self.admob:showAd( self.adType )
self.admob:setAlignment("center", "top")
require('ads') -- plugin
self.admob = Ads.new("admob") -- create an Ads object for admob
@ar2rsawseen
Thanks a lot for your help!, now I can see the ad, but my new issue is when I try to close the ad in eclipse show this error:
07-28 00:34:55.792: E/AndroidRuntime(24117): com.giderosmobile.android.player.LuaException: C:/Users/yaxxar/Documents/NNGAct/NNG/assets/assets/Classes/GameDemo.lua.jet:377: attempt to call method 'removeAd' (a nil value)
I tried to close like this
Likes: tuanleanh