Search Unity

How to deal with loss of internet connection?

Discussion in 'Unity Ads & User Acquisition' started by mellowVtuber, Feb 15, 2021.

  1. mellowVtuber

    mellowVtuber

    Joined:
    Feb 15, 2021
    Posts:
    27
    i can only find old posts about.

    what happens to my ads when internet connection is lost? does it automatically get my ads back when theres internet again?
    does "Advertisement.isInitialized" go to false if i lose connection?

    do i need to do something like this to to re initialize the ads if i lose connection?

    Code (CSharp):
    1.     IEnumerator reInitAds() {
    2.        
    3.         while (true) {
    4.  
    5.             if (!Advertisement.isInitialized) {Advertisement.Initialize(gameIdAndroid);}
    6.  
    7.             yield return wait;
    8.         }
    9.     }
    whats everything i need to know to deal with loss of connection?