Reagan McFarland Reagan McFarland - 2 months ago 16
Swift Question

Indoor Positioning and iBeacons

So I had this idea for an app that requires the position of a user's iPhone inside of a indoor area, like a house. I was going to use GPS and CoreLocation, but I realized that GPS services are bad/don't work indoors (for the accuracy I need, which is about +/- 3 meters). I heard of iBeacons and did some research on them to see if I could place those around "the house" and get the devices position in relation to the iBeacon. But, I read that they don't have good positioning since after ~10 meters the positioning isn't accurate. I am still sort of new to app development and was wondering if there was a way to accomplish device positioning indoors? Are their iBeacons with accurate range for positioning?

If this is the wrong place to post this, please redirect me to the right place :)


the CoreLocation Beacons detection APIs in iOS don't really give you something equivalent to GPS. GPS APIs will tell you "The phone is at these coordinates." Beacon APIs will tell you "The phone is near this beacon."

The simplest way to tell you where you are within a house using beacons is to put a bunch of beacons around the house in different rooms, and perhaps at multiple locations within rooms. But because beacon signals can travel 40 meters or more, you'll often see multiple beacons at the same time. So you end up with APIs that tell you "The phone is near this list of beacons." You can then take the list of beacons that you are near, find which is closest based on the rough distance estimates the APIs provide, and you can assume that you are at the position specified by the closest beacon.

Doing all of this requires you to assign unique identifiers to each beacon, and have some kind of lookup table or database (either embedded in your app or exposed as a web service) that maps each beacon identifier to a meaningful location. For example:

Beacon ID     Floor    Coordinates (meters from house NW corner)
65000         1        16, 23
65001         1        9, 45
65002         2        11, 14

Building all this is not trivial. Beacons provide a basic building block to setting it up, but it isn't quit as easy as getting a pair of coordinates from GPS.