Realtime - Websocket background and remote notifications

Hi -


I'm currently playing with websocket on ios.

Is there any way to keep websocket connections when the app is in the background or the phone is locked ?

I saw lots of tricky things like enable audio mode background or voip. Is it right with the ios guidelines ? even if my application is not an audio app..


Besides, I need to get remote notifications in realtime time. Actually, it depends on the traffic and sometimes, I get a delay of 4-10seconds. No way to avoid this delay?


Thanks.

Replies

Is there any way to keep websocket connections when the app is in the background or the phone is locked ?

Not easily. There’s nothing special about WebSocket here; under the covers it’s just a TCP socket and, as such, is subject to the general rules outlined in Technote 2277 Networking and Multitasking.

Is it right with the ios guidelines ?

App Review is pretty clear about their requirements here. See clause 2.5.4 of the App Store Review Guidelines.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
i have the same issue with this. Is this possible ? Because Whatsapp can do this somehow.

Is this possible?

A lot has changed in the intervening 3 years but the basic answer has not: Maintaining a network connection while in the background requires that the be running, and iOS puts strict limits on an app’s ability to run in the background. If you care to explain your specific requirements, I’d be happy to offer more concrete guidance.

ps Please start a new thread for this.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"