Unable to keep Websocket alive in background iOS
I am creating a VOIP application and also using a SocketRocket library to manage my Websockets and pull data from it. But my main problem is when I click on (IOS) Home button so my websocket disconnects after one minute. I have read Apple's documentation for developing VOIP application from the link below
I am also setting UIBackgroundModes in plist for VOIP and Audio, but when I resume my application so my websocket state is closed although I am not releasing websocket Object.
_webSocket.readyState =3 // It identifies that my websocket is close.
Now for restablishing a connection with Websocket so I need to call again websocket open and create another instance of Websocket object after releasing previously.
On closing of websocket my SIP registeration from my server also disconnects and I need to reconnect to my SIP again.
How can I prevent my websocket to get close and how can I make setKeepAliveTimeout:handler: useful to fix my problem.
Library use to establish Websocket is as below
Xcode-OTHER, iOS 6.1