IOS: Monitor a socket connected to a Wi-Fi device while an app is in the background

Some background: we recently took over the development of a client application from our existing hardware team, this application wirelessly connects to a pellet grill using a wireless card and a custom controller. On iOS, they communicate using CFSockets as there are many serialized bytes currently.

We need a service that can keep track of the data sent from the grill even if the app stays in the background. The reason we need this is to monitor things like low fuel alerts and probe temperature in food.

Usage example: The user starts the grill, sets the profile and goes back inside. The application goes into the background. One of the steps in the profile is to turn the meat when it reaches a certain core temperature. We should be able to send a local notification and play a beep when the meat is ready to flip, even if the phone is locked.

I think we need to use the background of external accessories, but I'm not sure how to set up a separate thread / task that runs even when the phone is sleeping. Most importantly, we need to be able to execute lightweight logic on the data received from the socket and notify the user when certain conditions are met that we cannot predict in advance. For longer grilling times, this may be more than a few hours.

Can anyone point me in the right direction which I should be using and all the possible roadblocks ahead?

Thanks in advance.

+3


source to share


1 answer


As such, we probably won't be able to fix this issue until we can use Grill to send push notifications from the server.

"Thank you for contacting Apple Developer Technical Support (DTS). Our engineers reviewed your request and concluded that there is no supported way to achieve the desired functionality given the current delivery system configurations."



As of 04/15/2015: We should have made the grids smarter and sent the alert through the push notification service. This works, but it would be better if Apple allowed us to maintain a background connection.

+2


source







All Articles