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

Unity 2022 Does not accept ads

$
0
0
I am using a basic ad script that I will provide below and, after upgrading to Unity 2022 so that I had the right android API level I now have problems with ads. Any and all ad scripts have errors that are not actual errors. I have the Advertisements Legacy and now an Advertisements Mediation package. Neither seem to help and it does not matter which one is attached, I still have these errors. Can you tell me how I can use the same basic ad script in my 2022 project? public class BannerAdScript : MonoBehaviour { public string gameId = "1234567"; public string placementId = "bannerPlacement"; public bool testMode = true; [SerializeField] BannerPosition _bannerPosition = BannerPosition.BOTTOM_CENTER; void Start() { // Initialize the SDK if you haven't already done so: Advertisement.Initialize(gameId, testMode); StartCoroutine(ShowBannerWhenReady()); // Set the banner position: Advertisement.Banner.SetPosition(_bannerPosition); } IEnumerator ShowBannerWhenReady() { while (!Advertisement.IsReady(placementId)) { yield return new WaitForSeconds(0.5f); } Advertisement.Banner.Show(placementId); } }

Viewing all articles
Browse latest Browse all 1416

Trending Articles



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