run in backround in Android
Options
Hi, Photon developer team:
I use two version of PUN.
1. android platform, version 1.17, click "home" button, photon disconnection when app run in background.
2. android platform, the latest version, click "home" button, photon connected all the time when app run in background.
problem: I want to the photon disconnect when run in background,
Is there a way to solve my problem by photon?
Thanks!
I use two version of PUN.
1. android platform, version 1.17, click "home" button, photon disconnection when app run in background.
2. android platform, the latest version, click "home" button, photon connected all the time when app run in background.
problem: I want to the photon disconnect when run in background,
Is there a way to solve my problem by photon?
Thanks!
0
Comments
-
Hi,
You can disconnect from server when app looses focus and reconnect when it gets back in foreground:
PhotonNetwork.Disconnect()
PhotonNetwork.ConnectUsingSettings("1.0");1 -
Hi, vadim:
Thank you for your reply.
Disconnect from server when app looses focus may have some problem.
When I receive a message from my friends, message will display, and then app will loose focus too, I think we shouldn't disconnect the photon when receive a message.
I want to disconnect photonnetwork when i enter into the background.
If not disconnect , user will exist in the room all the time, and the user's mirror is dead in the room all the time.0 -
I think we shouldn't disconnect the photon when receive a message. I want to disconnect photonnetwork when i enter into the background
Photon client simply gets disconnected automatically by server after about 10 sec. of inactivity. Or you can disconnect it explicitly whenever you want.0 -
Hi Vadim ,
Photon client simply gets disconnected automatically by server after about 10 sec. of inactivity.
I can not see the working for me !!
can you please look into this once
http://forum.photonengine.com/discussion/7751/onpause-to-be-called-in-android-phone#latest
0