what is the best way to determine if two iPhone users are in the same radius of lets say 1000 meters.
What I am thinking is, both phones find out there location, th开发者_开发技巧en submit it to a central server. The problem is how would I figure out if they are within a certain distance of each other.
Use the haversine formula on the server to get a rough estimate on distances, and serve only the closest 4 or 5 to a the clients phone, then it can get a more accurate distance using the method distanceFromLocation:
on CLLocation with just the few records sent by the server.
精彩评论