Skip to content Skip to sidebar Skip to footer

Saving Socket.io Client On Phonegap Resume Or Disconnecting It On Pause

I have a phonegap application which uses socket.io as means of communication. When application goes to pause the socket is kept alive in the background apparently, and on resume wh

Solution 1:

I have a similar issue. I also have a websocket-connection, that ought to be brought down when the app is sent to the background and reopened once the app is brought to the foreground again.

According to documentation, I'd use the "pause" event to tear down the communication and then reopen the socket when the "resume" event is received. But this only works as long as "keepRunning" is set to true (see keepRunning set to false - what does it really do on Android?).

Post a Comment for "Saving Socket.io Client On Phonegap Resume Or Disconnecting It On Pause"