I am working on a project where a stationary iPad will act as a BLE peripheral and an iPhone will act as a BLE central. As the iPhone enters within a few meters of the iPad, the iPhone will do something. The iPhone needs to be able to run in the background or locked.
I've been working with the CoreLocation library to create an iBeacon. Using ranging methods, CoreLocation allows me to find the accuracy and proximity of the beacon. However, from what I've found, CoreLocation does not allow for background ranging. I've also found that monitoring for a beacon region can trigger enter/exit events which allows me to launch the app temporarily (~5 seconds) to then range for accuracy and proximity. However, this solution would not work as the iPad's beaconing range is very large, and the central device would trigger the enter/exit events long before the device reaches my target range (a few meters of the peripheral).
Thus, I've been looking into the CoreBluetooth library as an alternative to CoreLocation/iBeacons. I am aware that using CoreBluetooth, I would have to manually calculate the distance based on the RSSI.
My first question is, Are my assumptions correct? Would CoreBluetooth be a good alternative to use for this project?
My second question is, Can the iPhone (central) determine the distance between itself and the iPad (peripheral) while locked or running in the background?
Thanks in advance!