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.

Question OnClientDisconnected not triggered on Android application close

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

  1. sanathkukkillaya


    Nov 14, 2019
    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.