Background mode for sustained networking

Hi.

I've been developing an iOS-/watchOS-app that connects to an embedded device, using swift-nio-ssh. While the iOS app takes care of the connection and all related data-munching, it doesn't have much of an UI. The Watch app is there to control the device, exchanging WatchConnectivity messages with the iPhone - the user will need their hands free.

As it stands, I have to keep the iPhone app active, because otherwise the connection will die within a few seconds. What the customer wants though, is to be able to do anything they please with their phone, while connected to the device: receive calls, answer messages, change settings, lock it, etc.

Now that I've made myself familiar with APIs Apple offers for extended background runtime, none of them fit my use case. From what I've gathered, it could be possible to abuse Audio, VoIP or NetworkExtension background modes, but then the app wouldn't make it through review.

Is there a way to get some kind of explicit approval for me doing the aforementioned (The app's supposed to be distributed in-house only through Apple Business Manager)?

If so, what would be the best way to go about it? Any hints?

Thanks for your time!

Realistically I would only attempt this communication while the iOS app is in the foreground. This will provide the best battery performance and will ensure that you connection is always given priority while the app is active. Doing so otherwise will cause strange inconsistencies or failures like you are mentioning.

Instead of abusing one of the mentioned APIs, I simply set up the Watch app to send messages non-stop at a short interval. I can lock the phone and use my connected device just fine, no inconsistencies or anything. Would this approach make it through app review?

Background mode for sustained networking
 
 
Q