Hi.
I’m developing a new game with ads, but I can’t find what can I do for make it works, at least the example screen.
I tried simple things like this, but I cant make it work.
public void ShowDefaultAd()
using UnityEngine;
using UnityEngine.Advertisements;
public class Adsbutton: MonoBehaviour {
public void ShowAd() {
if(Advertisement.IsReady()) {
Advertisement.Show();
}
}
}
I’m using the services integrated in unity, and it appears on the dashboard, but i don´t know what I have to do.
I tried another code, larger than this, but same thing… even initializing the ads.
From where do you call the ShowAd() method?
A button, with the event system
When I click the button, the functions ShowAd()
Do you get any error messages in editor when using playmode in Unity editor?
No, no one.
When I try to click the button, nothing happens
But suddenly appeared this.
In console window I got nothing.
I get this message in the Console window, when running a project with Ads enabled and have selected Android as build target:
Are you building for Android or iOS?
/Rasmus
I’m just testing ads, but I’m going to build for android
But really, my console window is empty when I run the project
Have you selected Android or iOS as build target in Build Settings window?
Hmm in fact I didnt select anything.
But now I have this warning
Did you sign out from Unity, since it now cannot get cloud project information? Alternatively restart Unity and make sure you are signed in with your Unity account.
/Rasmus
No I didnt, but I restarted and still the same
Ok, not sure what exactly state “same” above means. Please make sure you are logged into Unity with your Unity developer account and have selected Android or iOS as build target. Then it should work.
/Rasmus
You were rigth, I didn’t switch plattform.
Thank you so much.
Sorry for this long post.