Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Any harm in calling Advertisement.Initialize more than once?

Discussion in 'Unity Ads & User Acquisition' started by bigSadFace, Mar 1, 2015.

  1. bigSadFace

    bigSadFace

    Joined:
    Aug 18, 2014
    Posts:
    116
    I have the Advertisement.Initialize call on my main menu; however it is possible for the user to visit the main menu more than once. Is there any harm in calling Advertisement.Initialize more than once per play session?
     
  2. Salazar

    Salazar

    Joined:
    Sep 2, 2013
    Posts:
    235
    Hello bigSadFace,

    There is no harm I think, it throws a "you already initialized" .

    Regards,
     
    bigSadFace likes this.
  3. bigSadFace

    bigSadFace

    Joined:
    Aug 18, 2014
    Posts:
    116
    Thank you. I didn't think there was any harm. I wanted to call it reasonably regularly if the app is already running while switching between offline/online
     
  4. Salazar

    Salazar

    Joined:
    Sep 2, 2013
    Posts:
    235
    bigSadFace Hello Again,

    There are several scenarios;
    1- You have internet con, you initialize no proplem,
    2 You dont have internet con,you couldnt initialize, you opened internet mid of the game
    3 You have internet con. , you initialize ,you closed mid of the game and open again.

    First scenario , there is no problem.
    Second scenario (quote from Documentation)
    So its a good practice to check internet connection before Initialization

    Third scenario , I should test that one :D

    Regards,
     
  5. bigSadFace

    bigSadFace

    Joined:
    Aug 18, 2014
    Posts:
    116
    Interesting. Thank you for the additional detail.
     
    Salazar likes this.