0 votes

Im having problems with this for long time.
Im using godot admob master because one guy recommended it to me.
when I click watch button on my pc or phone it doesnt do anything.

var admob = null
var isReal = false
var isTop = true
var adBannerId = "ca-app-pub-3263458850279674/8492940341"
var adInterstitialId = "ca-app-pub-3263458850279674/8492940341"

func _ready():
    set_process(true)
    if(Globals.has_singleton("AdMob")):
        admob = Globals.get_singleton("AdMob")
        admob.init(isReal, get_instance_ID())
        loadBanner()
        loadInterstitial()

get_tree().connect("screen_resized", self, "onResize")

func loadBanner():
    if admob != null:
        admob.loadBanner(adBannerId, isTop)

func loadInterstitial():
    if admob != null:
        admob.loadInterstitial(adInterstitialId)


func _on_watch_pressed():
            admob.showInterstitial()

(sorry for the form, doesnt want to work as well)

in Engine by (328 points)
edited by

1 Answer

+3 votes
Best answer

There could be couple of problems in getting this to work:
1. check to see if you actually have the AdMob module loaded ( try a print in the first if statement from ready function).
If it's not loaded make sure you load the module, you can load the module from the project settings or you can directly edit your engine.cfg file, like this:
[android]
modules="org/godotengine/godot/GodotAdMob"

I don't exactly know how your module is called since mine is a custom build.
Presumably this should solve the problem, if it doesn't, the module still doesn't load, then maybe you should find out how is the module called, or maybe the build you have does not have the admob module in it. Did you re-compiled the engine with the module in it yourself ?

If you module is loading, the problem could come from Google. You should not be using the IDs given by Google for testing purposes because Google has strict policies on this and could ban you without notice.
Instead you should be using a "test" ID, that will ensure that you always receive and testing ad, otherwise it could be that now ad is available for your location at the time of testing.
This is the test ID for banners:
ca-app-pub-3940256099942544/6300978111
it should at least show you a test banner.
hope this helps....

by (523 points)
selected by

Thanks, I will try this.

I'm getting to run the test ads, but the real ones do not, because they have to put the APP ID, but I do not know how to add this ID, you know how to do it ??

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.