Search Unity

WebGL OnApplicationQuit() does not called

Discussion in 'Web' started by hacaro76, Sep 8, 2017.

  1. hacaro76

    hacaro76

    Joined:
    Oct 14, 2015
    Posts:
    25
    Hi all, I'm working on a multiplatform project (with also WebGL) that can save some value into the Player prefs during the Game Session. I need to clear these Prefs on Game Close(in this case, Tab Close or Browser quit). On desktop, i Use OnApplicationQuit to clear the prefs and works fine, but on WebGL it does not Called. there is a way to do this ? maybe usign a jslib that can trace the tab close ? or throug a Javascript function into the Html that clear the IndexDB of this Game ?

    I've see that there is an Issue tracker Won't Fix for this at

    https://issuetracker.unity3d.com/is...ity-web-player-when-closing-or-refreshing-tab

    I'm on Unity 5.6.2f1 (can not upgrade because i'm near to the release.)

    Hope that someone can drive me into the right way.

    Thanks in advance for the support and suggestions.
     
  2. blacKode

    blacKode

    Joined:
    May 21, 2015
    Posts:
    38
  3. Sakuwwz

    Sakuwwz

    Joined:
    Nov 5, 2018
    Posts:
    50
    @blacKodeI'm having the same issue and do you have any suggestions to do this? That would be really helpful