Maintaining MQTT connection in background

Hello,

I have an app that receives critical alarms. This is usually done through remote push notifications from the server, but to add redundancy I'd like to add a MQTT connection as well. There are scenarios where internet connection might be missing (but there is a local WiFi connection to the server) hence I'd like to deliver the alarms directly from server to client without going out via the Internet.

The problem is that according to all restrictions on iOS, the MQTT connection will not be maintained in the background and disconnect occurs within 20-30 sec after going in the background and shutting the screen.

I'm aware of all the background modes that iOS allows but none fall within this scenario.

Is there a way to maintain a MQTT connection (or some other type of network connection) in the background on iOS?

Replies

Is there a way to maintain a MQTT connection (or some other type of network connection) in the background on iOS?

No.

I talk about this in iOS Background Execution Limits. Please have a read of that and then come back with your follow-up questions.

Oh, one thing I should mention here is Local push connectivity.

Share and Enjoy

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