Unity ads wont work on mobile neither on editor

It is Always “failed” when I call ShowAds(), on adnroid, ios and editor. Can someone help me?

using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.UI;
 #if UNITY_ADS
 using UnityEngine.Advertisements;
 #endif
 
     void Start()
     {
         //Advertisement.Initialize(gameId);
 #if UNITY_ADS
         Advertisement.Initialize(gameId, enableTestMode);
 #endif
         //StartCoroutine(ShowAd());
     }
 
     public void ShowAD(bool reward)
     {
         if (reward)
         {
             ShowRewardedAd();
         }
         else
 
         {
             if (PlayerPrefs.GetInt("canShowAllADS") == 0)
                 ShowAds();
         }
     }
 
 
     private void ShowAds()
     {
         Debug.Log("call ADS");
 #if UNITY_ADS
         while (!Advertisement.IsReady())
         {
             Debug.Log("ADS NOT READY YET");
           
         }
         Advertisement.Show();
 
         Debug.Log("worked");
 #else
         Debug.Log("failed");
       
 #endif
     }

I tried to use a snippet to show the code to you but it did not worked =/

yesterday i think there was some problems with unity ads because i lose 90% Revenue

1 Like

@Dalmar1 , what does Console log say when you play in editor. Do you get an Initialize() call?

/Rasmus

same as me, maybe have problem with report Unity ads

Please some more details in that case. Device log, console log from editor or something more than a “it doesn’t work” message on a forum thread :wink:

I’ve checked server side monitoring, and except for a small “hiccup” around 2pm UTC time yesterday, nothing which should have affected revenue.

So please share some details, which can help us pinpoint your issues. @MrGky93 and @dinhbatri you are also welcome to contact our support on Technical Support if you continue to see this decrease in revenue.

/Rasmus

Thank for you reply, maybe coming from my side, I will check and contact with team support.
And Could you add earning report today on dashboard ?. Now we only see report yesterday and last 24 hours.
Thank you.

Last 24 hours isn’t sufficient in that case? What does “today” mean then?

that mean, I need know how many earning I got from 0h → current time today.
ex: I enter dashboard at 9h am, and I need know how many i got from 0h → 9h am.

Nothing appers on console log, the code does not run where I put “#if UNITY_ADS” on mobile or editor, the code just ignore it. I know that line just run when the device accept unity ads, so looks like that my device is not accepting it. And I do not get the Initialize() call

I tested with

#if UNITY_ADS
...
#else
Debug.log("teste");

and the debug shows on editor. I put it on a text to test on device and it also run only the #else

private void ShowAds()
{
Debug.Log("call ADS");
#if UNITY_ADS
while (!Advertisement.IsReady())
{
Debug.Log("ADS NOT READY YET");

}
Advertisement.Show();

Debug.Log("worked");
#else
Debug.Log("failed");

#endif
}

here the console log shows Call ADS and failed

I get the error ,
Assets/AdsController.cs(9,19): error CS0234: The type or namespace name Advertisements' does not exist in the namespace UnityEngine’. Are you missing an assembly reference?

Then I tried to reimport the asset package from the asset store, which fixes the build error, but no ADS are shown in app.
Also the Advertisements.IsReady() is always false but the Advertisements.IsInitialized() is true

@rasmus-unity do you have any tip for me? What can I do?

Anything?

I’m trying everything that I found online but nothing seens to work.
No console log erros, the code just ignore “#if UNITY_ADS” Always in any device. I have some resrict deadlines, anyone can help me? I am using a valid game id and the ads is not even initializing =/.