

Ask HN: Can any iOS Developers answer me this? - markcrazyhorse

As part of my iOS Development journey I want to create an app that will find users of the app within a specified radius of the current user. The best way I can describe this is like dating apps when you specify how far you want to search. How would I go about solving this - Has anyone got any great links or tutorials they could direct me to? Much appreciated.
======
informatimago
1- geolocation must be enabled by the user.

2- you may forward the position of each users to a central server and perform
the proximity matches there, and send back the list of close users. That means
that IP connectivity is required (GSM or Wifi).

In any case, you get precise geolocation only when you have wifi networks
visible, so you may as well require that the user enable wifi.

Once you have wifi enabled, it is possible to use it to scan close users
directly, without using geolocation, by mere physical closeness.

You can also do that with bluetooth for closer distances.

So, how you would go about this would depend on what level of privacy and what
kind of application you want to do that for.

~~~
markcrazyhorse
Thanks for the awesome reply. Gonna do some more googling now I know a little
more what i'm looking for :)

------
raooll
Hi,

Here is a quick and easy way.Index all the user locations into a elastisearch
instance and as soon as a user opens up the app , fire a near query on the
elastisearch with users current location as input and get all the other users
within a specified distance as json from the elasti instance.

This should help you
[http://www.elasticsearch.org/guide/en/elasticsearch/referenc...](http://www.elasticsearch.org/guide/en/elasticsearch/referenc..).

The second option is to use mongodb for the same, but the first solution is
much easier and faster to implement.

------
hackerboos
You're looking for PostGIS or another GIS solution.

With PostGIS you can use ST_DWithin to find results in a certain radius from a
longitude and latitude point which is retrieved from the cell phone in iOS.

------
lowken10
You need to post this question to Stackoverflow (www.stackoverflow.com).

~~~
markcrazyhorse
I would but the question is vague and has no code so will only be closed and
downvoted.

