- Home /
(Unity Ads) ShowResult.Failed not triggered without internet at initialization
Ok, the title is confusing i think.
So the following methods handle showing an ad and rewarding the player:
public void ShowAd()
{
var options = new ShowAdCallbacks();
options.finishCallback = HandleShowResult;
var ad = Monetization.GetPlacementContent(videoPlacementId) as ShowAdPlacementContent;
ad.Show(options);
}
void HandleShowResult(ShowResult result)
{
var adCanvas = Instantiate(AdCanvasPrefab).GetComponent<AdCanvas>();
adCanvas.Initialize();
int reward = 0;
if (result == ShowResult.Finished)
{
adCanvas.completed.SetActive(true);
reward = adWatchedReward;
}
else if (result == ShowResult.Skipped)
{
adCanvas.skipped.SetActive(true);
reward = adSkippedReward;
}
else if (result == ShowResult.Failed)
{
adCanvas.failed.SetActive(true);
reward = 0;
}
GameDataDoggy.AddPlayerCoins(reward);
adCanvas.coinText.text = "+" + reward.ToString() + " COINS";
}
If the phone is not connected to the internet at initialization, nothing here works, not even the Failed status. If the phone gains internet after initialization, again, nothing happens.
I hope you can understand what im trying to say.
Comment