Answer the question
In order to leave comments, you need to log in
Banner ads not working in release version of Unity?
Connected banner ads to the Unity game. The test version works fine and runs.
It's time to throw out the apk on Google Play and then the ads stopped working as soon as I turned off the test mod.
My suspicions: Unity Dashboard hasn't managed to find me an advertising campaign yet? Can anyone explain how this works? I don’t know if it makes sense to throw the source code, because again I repeat. In test mode, everything works, when I turn it off - no ..
Here's the code for everyone:
public string gameId = "*********";
public string placementId = "bannerPlacement"; //bannerPlacement
private bool testMode = false;
void Start()
{
Advertisement.Initialize(gameId, testMode);
StartCoroutine(ShowBannerWhenReady());
DontDestroyOnLoad(this.gameObject);
}
IEnumerator ShowBannerWhenReady()
{
while (!Advertisement.IsReady(placementId))
{
yield return new WaitForSeconds(0.5f);
}
Advertisement.Banner.SetPosition(BannerPosition.TOP_CENTER);
Advertisement.Banner.Show(placementId);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question