Ads are failing

I’m seeing this on Android:

2022-12-13 08:46:08.696 16385-16705/? E/Ads: Cannot determine request type. Is your ad unit id correct?
2022-12-13 08:46:08.700 16385-16385/? I/logger: ADAPTER_AD_NETWORK_ERROR: AdMob error with code (1) and message (Error building request URL: Cannot determine request type. Is your ad unit id correct?)
2022-12-13 08:46:08.700 16385-16674/? I/logger: Line item: ADMOB with values {adUnitId=AdMob_RV_High} failed to load.
2022-12-13 08:46:08.703 16385-16385/? I/Ads: Ad failed to load : 1
2022-12-13 08:46:08.709 16385-16698/? E/Ads: Cannot determine request type. Is your ad unit id correct?
2022-12-13 08:46:08.712 16385-16385/? I/logger: ADAPTER_AD_NETWORK_ERROR: AdMob error with code (1) and message (Error building request URL: Cannot determine request type. Is your ad unit id correct?)
2022-12-13 08:46:08.712 16385-16669/? I/logger: Line item: ADMOB with values {adUnitId=AdMob_INT_High} failed to load.
2022-12-13 08:46:08.714 16385-16385/? I/Ads: Ad failed to load : 1

I am fairly sure everything is setup correctly.

The ID’s in my mediation window in Unity show as follows:

And I am sure that my setup is correct:

private IInterstitialAd _ad;
        private const string AdUnitId = "Interstitial_Android";

        public void SetupAd()
        {
            //Create
            _ad = MediationService.Instance.CreateInterstitialAd(AdUnitId);

            //Subscribe to events
            _ad.OnClosed += AdClosed;
            _ad.OnClicked += AdClicked;
            _ad.OnLoaded += AdLoaded;
            _ad.OnFailedLoad += AdFailedLoad;
           
            // Impression Event
            MediationService.Instance.ImpressionEventPublisher.OnImpression += ImpressionEvent;
        }

NOTE: I am setting up unity services much earlier in the app using:

var initializationOptions = new InitializationOptions();
            initializationOptions.SetGameId(GameId);
            await Task.WhenAny(UnityServices.InitializeAsync(), Task.Delay(3000));

^^^ I am also connected to the internet and can see that this is finishing correctly as desired.

Here are the look of my unity waterfalls for my rewarded:

Please help thankyou

Noticed this error:

2022-12-13 10:26:05.270 20040-20099/? E/Unity: AndroidJavaException: java.lang.NullPointerException: Parameter specified as non-null is null: method kotlin.jvm.internal.i.d, parameter userId
java.lang.NullPointerException: Parameter specified as non-null is null: method kotlin.jvm.internal.i.d, parameter userId
at com.unity3d.mediation.RewardedAdShowOptions$S2SRedeemData.<init>(Unknown Source:2)
at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
at com.unity3d.player.UnityPlayer.access$300(Unknown Source:0)
at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:95)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)
at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.AndroidJNISafe.NewObject (System.IntPtr clazz, System.IntPtr methodID, UnityEngine.jvalue[ ] args) [0x00000] in <00000000000000000000000000000000

Should I be using these ID’s? but then how would it use other Networks? Also how is this setup as I don’t have an admob account that I know of, this was automatically built by Unity? When you do code sample it uses the normal app id’s as I had them before

It’s working now because I added s2s redeem data like this:

try
                {
                    var s2SRedeemData = new S2SRedeemData();
                    s2SRedeemData.UserId = "UserId";
                    s2SRedeemData.CustomData = "CustomData";
                    var showOptions = new RewardedAdShowOptions {S2SData = s2SRedeemData, AutoReload = true};
                    showOptions.AutoReload = true;
                    await _ad.ShowAsync(showOptions);
                    AdShown();
                }

This isn’t in the code generator OR the documentation for unity mediation. Please update the documentation!

Hi @Factori_Danny ,
I remember a bug from a while ago where s2s mistakenly became mandatory but it has been fixed. I would recommend that you update your package, or if it is already on the latest version please send us a copy of your logs so we can investigate.

Thanks for the feedback!