I'm working on a project with iBeacon that requires the app run constantly in the background. Nevermind the practicality of this, please. The iBeacon API doesn't allow apps to range in the background constantly or receive any other communication other than enter/exit events (accept in the case where you set the needsDisplay flag, but this isn't as passive as I need it to be). Once in a particular region, it seems you can't detect which beacon you're closest to while the app is completely backgrounded.
In order to hack this into working, I set up a couple of iOS devices as CoreBluetooth peripherals, plugged in and always on that the app can constantly "discover." Because the BLE profile used for the peripherals are "connectable," the app can stay on infinitely in the background and iBeacon ranging is possible all throughout the day. To boot, I've seen very minimal battery life reduction.
The problem now, is that every other day or so, the app quits and is not awakened by the enter/exit events, nor is it awakened by the other BLE devices when in range.
I understand that with a hacky solution like this, there are bound to be a myriad of problems, but for the life of me I can't narrow down what might be causing this. Thoughts?