I'm writing an iOS application for enterprise deployment. The use case is that it is meant to run in the foreground in kiosk / guided access mode on iPads, and it must never ever close for as long as the OS is running (the iPads will be mounted on a wall and plugged into a power source).
I've set the iPad to never go to the lock screen, and I've put in the necessary IdleTimerDisable code. I set up Guided Access to run the app, and off it goes.
Everything works like a charm during the day. I can leave the iPad sitting there all day with the app in the foreground and it behaves exactly as expected. However some time overnight, something causes the application to close and when I arrive to work in the morning, the iPad is sitting on the home screen.
I keep the iPad connected to my Mac with the console open, but examining the logs and the console output doesn't reveal anything out of the ordinary.
I also have exception handling and logging code in place, but reviewing those logs shows no exception is being thrown either.
The behavior is consistent: I can keep the app open all day without issue, but by the next morning it is closed. Sometimes I can re-launch the app with Guided Access running, and sometimes I get trapped with Guided Access on the home screen preventing me from re-launching the app and I have to force the iPad to reboot.
Question: Does iOS perform some kind of clean up overnight that would cause the application to exit like this, or is there some other explanation?
If the OS is closing the app, how can I get around that?
Pertinent information: I've developed the app in Xamarin. The app continuously polls a REST API, via background threads, for as long as the app is open. Also, the iPad the app is currently on is not jailbroken, but I can jailbreak it if I need to to get past this issue.