Quantcast
Channel: Questions in topic: "ios"
Viewing all articles
Browse latest Browse all 4709

(Unity Ads) ShowResult.Failed not triggered without internet at initialization

$
0
0
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.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.

Viewing all articles
Browse latest Browse all 4709

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>