Your phone can tell where you are pretty well. The native location libraries use a combination of GPS and Wifi to determine where it thinks you are. That's not good enough, though, for your phone to know specifically where you are on all 3 axes inside a building.
This talk will go over the basics of using location APIs, using bluetooth beacons (iBeacon), and communicating with a server to make contextual sense of where exactly you are in the world and also in a building.