Search Unity

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

Question Unity game crashes when Ad is in production mode

Discussion in 'Unity Ads & User Acquisition' started by Milez770, Apr 20, 2022.

  1. Milez770

    Milez770

    Joined:
    Jul 26, 2016
    Posts:
    11
    I've done testing through test mode, uploaded on play store as internal test and everything was fine.
    When I switched the mode to production mode on Unity Ad, app crashes after Ad complete.
    How can I debug this situation?
     
  2. Milez770

    Milez770

    Joined:
    Jul 26, 2016
    Posts:
    11
    Solved.
    Actually Happens to be a bug in Advertisement Asset.
    Known issue, and said will be solved in 4.2.0.

    Meanwhile the solution is to make
    Code (CSharp):
    1. IEnumerator callback{
    2.     yield return null
    3.    // do stuff after Unity Ad Event Fired
    4. }
    and then on the event you want to run callback, (in my case onWatchCompleted)
    Code (CSharp):
    1. public void onWatchCompleted(){
    2.    StartCoroutine(callback());
    3. }
    this will put callback method on main thread.