Search Unity

Bug How to use Skip and Close buttons on test ads?

Discussion in 'Unity Ads & User Acquisition' started by enhawk, Nov 25, 2021.

Thread Status:
Not open for further replies.
  1. enhawk

    enhawk

    Joined:
    Aug 22, 2013
    Posts:
    833
    Using the example completion state code provided by Unity, finished & skipped works fine on device with test mode off, but OnUnityAdsShowComplete doesn't seem to work in editor or when in test mode.

    Code (CSharp):
    1. public void ShowAd()
    2.     {
    3.         Advertisement.Show(_adUnitId, this);
    4.     }
    5. public void OnUnityAdsShowComplete(string adUnitId, UnityAdsShowCompletionState showCompletionState)
    6.     {
    7.         switch(showCompletionState)
    8.         {
    9.             case UnityAdsShowCompletionState.COMPLETED:
    10.             case UnityAdsShowCompletionState.SKIPPED:
    11.                 // lets run our function here
    12.                 // nothing happens in editor, or when ads are set to test mode
    13.                 // works fine if test mode is off, on device
    14.             break;
    15.         }
    16.     }
    Would it be possible to explain how to fire a function from the test ad buttons "Skip" and "close"? Theres no working example in the official documentation, the example code doesn't trigger in editor play mode.
     
    cristian_crc likes this.
  2. enhawk

    enhawk

    Joined:
    Aug 22, 2013
    Posts:
    833
    bump
     
  3. enhawk

    enhawk

    Joined:
    Aug 22, 2013
    Posts:
    833
    I guess it doesn't work.

    Using work around.
     
  4. cristian_crc

    cristian_crc

    Joined:
    Aug 18, 2014
    Posts:
    1
    just ran into this issue also.

    showCompletionState is UnityAdsShowCompletionState.COMPLETED even if I click "skip" on the test ad.
     
Thread Status:
Not open for further replies.