pkyeck / socket.IO-objc

socket.io v0.7.2 — 0.9.x for iOS and OS X
MIT License
1.97k stars 439 forks source link

How to maintain socket connection in background?? #232

Open vikrantrajput opened 6 years ago

vikrantrajput commented 6 years ago

Hello everyone, I am using socket.IO-objc in my project using XCode9.0. I am trying to paring or connect with hardware device with using particular IP Address and Port which connect successfully. I am using below code. // create socket.io client instance socketIO = [[SocketIO alloc] initWithDelegate:self]; [socketIO connectToHost:@"myHost" onPort:port];

and then I am getting response from

Thanks

mhisham commented 6 years ago

Yes, ios break all socket connections when your app goes in background, for that reason you have to support Push notification for important actions or get the updates every time your app reconnect again. Hope that helps