Search Unity

Question OnClientDisconnected not triggered on Android application close

Discussion in 'Netcode for GameObjects' started by sanathkukkillaya, Nov 4, 2022.

  1. sanathkukkillaya

    sanathkukkillaya

    Joined:
    Nov 14, 2019
    Posts:
    37
    I am working on a mobile multiplayer game with a dedicated server. To enable reconnection, I store the session data, and mark the player as disconnected in the OnClientDisconnected method of the server. However, when I close the app from the phone, this event is not getting triggered. This works on editor, but when I take a build, and try to force close the app, it is not getting triggered. Due to this, the reconnection logic does not work. Please guide me on how to trigger the OnClientDisconnected in this scenario.