The ads test running on the editor, but not after building to android. When in editor mode the test running like this
as you can see the test mode also enable test mode on those services and the dashboard at Unity. I'm using Unity monetization from the asset store with v 3.4.6. This is my script :
using System.Collections;
using UnityEngine;
using UnityEngine.Advertisements;
public class UnityAds : MonoBehaviour, IUnityAdsListener
{
[Header("Ads Stuff")]
public string Google_ID = "******";
bool testMode = true;
public string myPlacement = "rewardedVideo";
void Awake()
{
Advertisement.AddListener(this);
Advertisement.Initialize(Google_ID, testMode);
}
// calling when player Death
public void DisplayVideoAds()
{
StartCoroutine(ShowRewardedVideo());
Debug.Log("Test Mode activate");
}
#if UNITY_ANDROID|| UNITY_IOS
public IEnumerator ShowRewardedVideo()
{
// Check if UnityAds ready before calling Show method:
while (!Advertisement.IsReady())
{
yield return new WaitForSeconds(1);
}
Advertisement.Show();
}
#endif
// Implement IUnityAdsListener interface methods:
public void OnUnityAdsDidFinish(string placementId, ShowResult showResult)
{
// Define conditional logic for each ad completion status:
if (showResult == ShowResult.Finished)
{
// Reward the user for watching the ad to completion.
Debug.LogWarning("You got A 2x Reward !!");
}
else if (showResult == ShowResult.Skipped)
{
// Do not reward the user for skipping the ad.
Debug.LogWarning("You got A Min Reward !!");
}
else if (showResult == ShowResult.Failed)
{
Debug.LogWarning("The ad did not finish due to an error.");
}
}
public void OnUnityAdsReady(string placementId)
{
// If the ready Placement is rewarded, show the ad:
if (placementId == myPlacement)
{
// Optional actions to take when the placement becomes ready(For example, enable the rewarded ads button)
}
}
public void OnUnityAdsDidError(string message)
{
// Log the error.
}
public void OnUnityAdsDidStart(string placementId)
{
// Optional actions to take when the end-users triggers an ad.
}
// When the object that subscribes to ad events is destroyed, remove the listener:
public void OnDestroy()
{
Advertisement.RemoveListener(this);
}
}
I don't have a clue what happened but nothing show error on Debug :
and last I have warning like this
Please consider upgrading to the Packman Distribution of the Unity Ads SDK. The Asset Store distribution will no longer be supported after Unity 2018.3
is that cause not working on android? have I must publish a beta app on google play store first for the test?