iOS applications in general can’t run at all when not in the foreground—they go to sleep soon after you navigate away from the app. There’s very few exceptions to this (e.g., if you’re a music app), and even iBeacon apps can only be woken up for a few seconds when entering/exiting range of beacons.
There’s a few tricks that might interest you being discussed in this thread: