I made an app that is currently active in the Play Store, checked “Force test mode OFF (i.e. use real ads) for all devices” and unchecked “enable test ads” in the unity service window. Also, the ad banner never appeared, I don’t know if it’s because I did a wrong implementation, thanks in advance.
This is my code
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Advertisements;
public class adv: MonoBehaviour
{
string gameId = "xxxxxxx";
bool testMode = false;
public string placementId = "bannerPlacement";
public string placementIds = "video";
void Start()
{
Advertisement.Initialize(gameId, testMode);
StartCoroutine(ShowBannerWhenReady());
}
void Update()
{
if (PlayerPrefs.GetFloat("ADV") >= 10)
{
ShowInterstitialAd();
PlayerPrefs.SetFloat("ADV", 0);
}
}
public void ShowInterstitialAd()
{
if (Advertisement.IsReady(placementIds))
{
Advertisement.Show(placementIds);
}
else
{
Debug.Log("Interstitial ad not ready at the moment! Please try again later!");
}
}
IEnumerator ShowBannerWhenReady()
{
while (Advertisement.IsReady(placementId))
{
yield return new WaitForSeconds(0.5f);
}
Advertisement.Banner.SetPosition(BannerPosition.BOTTOM_CENTER);
Advertisement.Banner.Show(placementId);
}
public void OnUnityAdsDidFinish(string placementIds, ShowResult showResult)
{
if (showResult == ShowResult.Failed)
{
ShowInterstitialAd();
}
}
}