hello, i’m getting a weird problem, when i have code and tested my ads manager it was working on editor and on my android device.
now i have upgrade to unity 5.5.0 and i’m testing some new behaviors on my game and it is working on the editor but not in my android device, in the editor i get the unity ads test screen that says that there will be an unity video ads and a button to let it close, but in my android device i don’t get anything, i checked and isReady(rewardedVideo) is always false on the android device.
here is my ads manager code
using UnityEngine;
using System.Collections;
using UnityEngine.Advertisements;
public class ads_manager : MonoBehaviour {
int WhereTo = 0;
Manager wManager;
void Start () {
Advertisement.Initialize("1195102", true);
wManager = GameObject.Find("Game Manager").GetComponent<Manager>();
}
//ifrom ==>0 restart
//ifrom ==>1 garage
public void ShowAD(int iFrom)
{
WhereTo = iFrom;
if (Advertisement.IsReady("rewardedVideo"))
{
var options = new ShowOptions { resultCallback = HandleShowAD };
Advertisement.Show("rewardedVideo", options);
}
}
public void HandleShowAD(ShowResult result)
{
switch (result)
{
case ShowResult.Finished:
Debug.Log("The ad was successfully shown.");
if (WhereTo == 0)
{
wManager.ShowEarnedCoins(5);
wManager.restart();
}
if (WhereTo==1)
{
wManager.ShowEarnedCoins(5);
wManager.garage();
}
break;
case ShowResult.Skipped:
Debug.Log("The ad was skipped before reaching the end.");
if (WhereTo == 0)
{
wManager.ShowEarnedCoins(0);
wManager.restart();
}
if (WhereTo == 1)
{
wManager.ShowEarnedCoins(0);
wManager.garage();
}
break;
case ShowResult.Failed:
Debug.LogError("The ad failed to be shown.");
if (WhereTo == 0)
{
wManager.ShowEarnedCoins(0);
wManager.restart();
}
if (WhereTo == 1)
{
wManager.ShowEarnedCoins(0);
wManager.garage();
}
break;
}
}
}
any idead why i’m geting always false on my android device ?
thanks in advance for all the help.