- Home /
This question was
closed Jan 22, 2018 at 09:43 PM by
TorchKing for the following reason:
solved
Question by
TorchKing · Jan 22, 2018 at 06:44 PM ·
unity 5adsunity adsadvertising
unity ads work fine in the editor but on my phone it doesn't give me an ad
i have placed ads in my game to get items but it doesn't seem to work on my phone while it does work in the editor i've searched arround on the internet but couldn't find anything useful i hope someone can help...
ad script: using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Advertisements; using UnityEngine.UI;
public class ad2 : MonoBehaviour {
public GameObject Error;
public float Bonuskaas;
public Text bonusdisplay;
void Start() {
Advertisement.Initialize ("GameID", false);
}
void Update() {
Bonuskaas = kaasHandler.kps * 60 * 10;
bonusdisplay.GetComponent<Text> ().text = "+ " + Bonuskaas;
}
public void ButtonClicked() {
if (Advertisement.IsReady("rewardedVideo")) {
var options = new ShowOptions { resultCallback = HandleShowResult };
Advertisement.Show ("rewardedVideo", options);
}
}
private void HandleShowResult(ShowResult result) {
switch (result) {
case ShowResult.Finished:
Debug.Log ("ad finished");
Click.kaas += Bonuskaas;
break;
case ShowResult.Skipped:
Debug.Log ("ad was skipped");
break;
case ShowResult.Failed:
Debug.Log ("ad failed to be shown");
Error.SetActive (true);
break;
}
}
}
it doesn't show me my error gameobject either btw
Comment
Follow this Question
Related Questions
Should my Unity Ads ECPM be 0? 2 Answers
Why is Unity Ads not showing an ad in unity 5.2? 5 Answers
Unity Ads Banner not working. 0 Answers
Disable Unity Ads 1 Answer
Why Is The Platform Section Missing From Unity Ads Service? 1 Answer