Android and disconnecting/reconnecting clients

Options
Hi,
I am using Unity 5.3.4 with PUN free version from asset store. I use ConnectAndJoinRandom script from plugin's folder with auto connect option, one scene, 2 players, few scene objects.

When I deploy standalone clients everything works great. But switching to android platform makes some troubles. When I kill android app, it hangs for a time in a room. Opening and closing client in editor works ok even when it is switched to android. I guess this is somehow connected with android itself, that application is first suspended and server keeps client online. Anyway, how to handle this issue?

My second problem is that when I reconnect android client I get warnings "Received RPC "" for viewID but this PhotonView does not exist!". I checked forum before and see that creating lobby scene could help, but it just doesn't suit to my game. Again, I haven't noticed anything like this warning working with standalone version.

Any ideas how to solve both problems? Thanks in advance!

Comments

  • Hi,


    Can you tell us how do you actually reconnect?

    Maybe you could watch for OnApplicationPause and OnApplicationFocus

    Bye,

    Jean
  • Korush
    Options
    Hi jeanfabre,
    To kill android client I use home button and then I use task manager to kill the app. I use OnApplicationPause and LeaveRoom from Photon API, but I get warning that current room is null (I don't remember message exactly, sorry).