Search Unity

App freezes after close admob Interstitial

Discussion in 'Android' started by toantbk, Mar 17, 2019.

  1. toantbk

    toantbk

    Joined:
    Jun 14, 2014
    Posts:
    8
    Hi all,

    I have some problem with admob Interstitial, my app is freezes after user close Interstitial ads (app not responding). Not all of Interstitial encountered this problem, look seem only countdown to close ads.
    This is my log, please help, thank you!

     
  2. ShaheelS

    ShaheelS

    Joined:
    Jun 22, 2018
    Posts:
    4
    Did you find any solution? I'm still having this same issue. App is working fine on android but game freezes on iOS when interstitial ad shows
     
  3. Klausology

    Klausology

    Joined:
    Aug 29, 2017
    Posts:
    131
    I was having the same issue as well. It was not working on Android initially but somehow resolved itself. Unfortunately for iOS, it always froze after closing the interstitial Ads. Turns out the freezing was due to the interstitial being destroyed after it is opened. I originally had a function "OnApplicationPause" that destroys interstitial Ads. I did this to prevent memory leaks of any kind. Removing this function stopped all freezes on iOS. This was my function:


    Code (CSharp):
    1.    public void OnApplicationPause(bool pause)
    2.    {
    3.         if (pause)
    4.         {
    5.        
    6.            //destroy interstitial
    7.             if (interAd != null)
    8.                interAd.Destroy();
    9.         }
    10.     }
    But of course, this does not seem to explain why it happened on Android initially and why it stopped either. I hope this might provide an idea of some sort on where the issue could be coming from.
     
    dimtreo likes this.