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

UnityAds Rewarded Video not showing after android build

$
0
0
I use UnityAds and try to show a rewarded ad in my android game. In the Editor everything worked fine, but after i build the apk and loaded it on my smartphone it doesnt work anymore (On my phone; in the editor everythig runs like it should). When I press the UI Button the rewarded ad doesn't show up, but my banner ad works fine. After pressing the UI button, my code attaches this script to a GameObject public class RewardedAdScript : MonoBehaviour, IUnityAdsListener { private string gameId = "XXXXXX", placementId = "rewardedVideo"; private void Start() { Advertisement.AddListener(this); Advertisement.Initialize(gameId, true); Advertisement.Load(placementId); } private void RewardPlayer() { //reward the player Destroy(this); } private void OnDestroy() { `` Advertisement.RemoveListener(this); } public void OnUnityAdsReady(string placementId) { if (placementId == this.placementId) { Advertisement.Show(placementId); } } public void OnUnityAdsDidError(string message) { } public void OnUnityAdsDidStart(string placementId) { } public void OnUnityAdsDidFinish(string placementId, ShowResult showResult) { if (showResult == ShowResult.Finished && placementId == this.placementId) { RewardPlayer(); } } } Does someone know what went wrong?

Viewing all articles
Browse latest Browse all 1416

Trending Articles



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