When I build my game into an .apk file and run it, no banner ads appear whatsoever. I did some debugging and found that the banner ads are not appearing due to this error (Error Code 509 No Mediation Fill); Here is the entire error as it appeared on Android logcat
2024/12/21 19:59:40.444 20814 20839 Error Unity LevelPlayAds:ErrorMessage(LevelPlayAdError)
2024/12/21 19:59:40.444 20814 20839 Error Unity UnityEngine.WorkRequest:Invoke()
2024/12/21 19:59:40.444 20814 20839 Error Unity UnityEngine.UnitySynchronizationContext:Exec()
2024/12/21 19:59:40.444 20814 20839 Error Unity
2024/12/21 19:59:40.446 20814 20839 Error Unity Error Code: 509
2024/12/21 19:59:40.446 20814 20839 Error Unity LevelPlayAds:ErrorMessage(LevelPlayAdError)
2024/12/21 19:59:40.446 20814 20839 Error Unity UnityEngine.WorkRequest:Invoke()
2024/12/21 19:59:40.446 20814 20839 Error Unity UnityEngine.UnitySynchronizationContext:Exec()
2024/12/21 19:59:40.446 20814 20839 Error Unity
2024/12/21 19:59:40.447 20814 20839 Error Unity Error Message: Mediation No fill
2024/12/21 19:59:40.447 20814 20839 Error Unity LevelPlayAds:ErrorMessage(LevelPlayAdError)
2024/12/21 19:59:40.447 20814 20839 Error Unity UnityEngine.WorkRequest:Invoke()
2024/12/21 19:59:40.447 20814 20839 Error Unity UnityEngine.UnitySynchronizationContext:Exec()
And here is the code I wrote for initializing the sdk, loading the ads and then showing them.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using com.unity3d.mediation;
public class LevelPlayAds : MonoBehaviour
{
private LevelPlayBannerAd bannerAd;
private void Awake()
{
DontDestroyOnLoad(this.gameObject);
Initialize();
}
void Initialize()
{
LevelPlayAdFormat[] legacyAdFormats = new[] { LevelPlayAdFormat.REWARDED, LevelPlayAdFormat.BANNER };
LevelPlay.OnInitSuccess += SdkInitializationCompletedEvent;
LevelPlay.OnInitFailed += SdkInitializationFailedEvent;
LevelPlay.Init("ID", "UserId", legacyAdFormats);
}
private void SdkInitializationCompletedEvent(LevelPlayConfiguration config)
{
Debug.Log("Initialization Complete!");
bannerAd = new LevelPlayBannerAd("ID");
LevelPlayAdSize adSize = LevelPlayAdSize.BANNER;
LoadBannerAd();
}
private void SdkInitializationFailedEvent(LevelPlayInitError config)
{
Debug.Log("Initialization Failed :(");
LevelPlay.OnInitSuccess -= SdkInitializationCompletedEvent;
LevelPlay.OnInitFailed -= SdkInitializationFailedEvent;
Initialize();
}
void OnApplicationPause(bool isPaused)
{
IronSource.Agent.onApplicationPause(isPaused);
}
void LoadBannerAd()
{
bannerAd.LoadAd();
Debug.Log("Loading Ad...");
bannerAd.OnAdLoadFailed += ErrorMessage;
bannerAd.OnAdLoaded += ShowBanner;
}
void ShowBanner(LevelPlayAdInfo config)
{
Debug.Log("The has been loaded and should be displayed!");
bannerAd.ShowAd();
}
void ErrorMessage(LevelPlayAdError config)
{
Debug.LogError("Ad failed to load D:");
Debug.LogError("Error Code: " + config.ErrorCode);
Debug.LogError("Error Message: " + config.ErrorMessage);
}
}
I looked around for solutions but so far I found nothing; I set everything up for my project in IronSource and Unity Ads, so I truly don’t know what is going wrong here. Any help or guidance would be heavily appreciated. Thank You.