3

As the title says, how am I able to keep the connection open and receive messages even when the app is in the background? Because now, everytime i set it to background or i lock my iPhone and unlock it, the websocket gets disconnected.

I've already found a solution and it says i should enable Voip in my Info.plist and then just do socket.voipEnabled = true, but it then says that Websocket does not have the member voipEnabled.

Does anyone have a quick example on how to run Websocket in background?

I am using the Starscream framework for Websockets

Thanks in advance

  • 1
    There is no way to run app in background other than the functionalities defined by Apple. Go through the link and check available tasks https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html – miOS Jan 23 '18 at 09:11

0 Answers0