I have a problem with unity ads, when i start the game with AdsInitializer, error will pop up that looks like this: Invalid configuration request for gameId: 5XXXXX4
UnityEngine.Advertisements.Utilities.CoroutineExecutor:Update () (at Library/PackageCache/com.unity.ads@4.4.2/Runtime/Advertisement/Utilities/CoroutineExecutor.cs:17)
I’ve tried everything, changed to android, checked my id, and everything was right! Can someone help me?
My code:
using UnityEngine;
using UnityEngine.Advertisements;
public class AdsInitializer : MonoBehaviour, IUnityAdsInitializationListener
{
[SerializeField] string _androidGameId;
[SerializeField] string _iOSGameId;
[SerializeField] bool _testMode = true;
private string _gameId;
void Awake()
{
InitializeAds();
}
public void InitializeAds()
{
#if UNITY_IOS
_gameId = _iOSGameId;
#elif UNITY_ANDROID
_gameId = _androidGameId;
#elif UNITY_EDITOR
_gameId = _androidGameId; //Only for testing the functionality in the Editor
#endif
if (!Advertisement.isInitialized && Advertisement.isSupported)
{
Advertisement.Initialize(_gameId, _testMode, this);
}
}
public void OnInitializationComplete()
{
Debug.Log(“Unity Ads initialization complete.”);
}
public void OnInitializationFailed(UnityAdsInitializationError error, string message)
{
Debug.Log($“Unity Ads Initialization Failed: {error.ToString()} - {message}”);
}
}