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

Unity Ads广告在手机上显示不了

$
0
0
用了Unity Ads的插件,在Unity编辑器下可以测试正常,也说正常显示广告。但当我打包APK放到手机上时,就不显示了,下面是我的代码和后台截图。。。。有谁知道为什么吗?我挂VPN还是显示不了。。。 using UnityEngine; using UnityEngine.Advertisements; public class Ads : MonoBehaviour { void Start() { if (!Advertisement.isInitialized) { Advertisement.Initialize("1172479", false); Debug.Log("1172479"); } else { Debug.Log(">>>>>><<<<<<<"); } } public void ShowAd() { print(Advertisement.IsReady()); if (Advertisement.IsReady()) { Advertisement.Show(); } } public void ShowRewardedAd() { if (Advertisement.IsReady("test")) { var options = new ShowOptions { resultCallback = HandleShowResult }; Advertisement.Show("test", options); } } private void HandleShowResult(ShowResult result) { switch (result) { case ShowResult.Finished: Debug.Log("The ad was successfully shown."); // // YOUR CODE TO REWARD THE GAMER // Give coins etc. break; case ShowResult.Skipped: Debug.Log("The ad was skipped before reaching the end."); break; case ShowResult.Failed: Debug.LogError("The ad failed to be shown."); break; } } } ![alt text][1] [1]: /storage/temp/80569-bhafa7d8q9-dy6t-ydzb.png

Viewing all articles
Browse latest Browse all 1416

Trending Articles



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