Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Ads must be initialized before calling show

Discussion in 'Unity Ads & User Acquisition' started by KEIKAS, Dec 24, 2021.

Thread Status:
Not open for further replies.
  1. KEIKAS

    KEIKAS

    Joined:
    Jan 5, 2020
    Posts:
    3
    It is saying "Ads must be initialized before calling show" even tho I initialize them.


    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEngine.Advertisements;
    5. public class Advertise : MonoBehaviour
    6. {
    7.     public string id = "myid";
    8.     // Start is called before the first frame update
    9.     public void Start()
    10.     {
    11.         Advertisement.Initialize(id, true);
    12.         ShowAd();
    13.     }
    14.  
    15.     // Update is called once per frame
    16.     public void ShowAd()
    17.     {
    18.         Advertisement.Show(id);
    19.     }
    20. }
    21.  
     
  2. D12294

    D12294

    Joined:
    Oct 6, 2020
    Posts:
    81
    Unity_Quinn, Jason_YLin and KEIKAS like this.
Thread Status:
Not open for further replies.