You can leave a room as the app goes to background using Unity’s feature.
When a mobile app that uses STRIX goes to background, it is usually disconnected from the server and leaves the room. The time before the actual disconnection differs for the OS and its version, and if it is Android, also depends on the manufacturer or the model, but anyway it will be in a second to about 2 minutes.
Unity has a callback called OnApplicationPause, which is called when a mobile app goes to background or returns to active. You can use it to shorten the delay before leaving. Call LeaveRoom when the app goes to background so that it leaves the room without waiting for disconnection.
When getting back from background to active state, the client is not in a room and replicas have been deleted. It can’t just continue playing. You need to perform an appropriate handling such as joining the same room as before again or transit to another appropriate scene (such as the home scene).
An argument of OnApplicationPause of Unity indicates whether going to background or returning. Consult your Unity documentation for details.