Quantcast
Channel: Questions in topic: "ads"
Viewing all articles
Browse latest Browse all 1416

Unity Ads not working?

$
0
0
Hi, I have recently implemented Unity Ads into my android game, but it does not appear to be working. I have code that checks if and ad is ready, and if it is, enables a button to show an ad. When i launch my game on my device, the button is never enabled. Here is my code: void Update () { if(!Advertisement.isInitialized && button == "Revive") { Advertisement.Initialize("MY_GAME_ID", true); } if(Advertisement.IsReady() && button == "Revive") { GetComponent().enabled = true; GetComponent().enabled = true; } } void OnMouseUp() { if(button == "Revive") { if(Advertisement.IsReady()) { Advertisement.Show(null, new ShowOptions { resultCallback = result => { Debug.Log(result.ToString()); player.GetComponent().revive(); player.transform.position = insPlayer; gameObject.SetActive(false); } }); } } } It works in the editor, but not on my device. Any ideas? Any help is greatly appreciated, thanks.

Viewing all articles
Browse latest Browse all 1416

Trending Articles



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