TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Can any iOS Developers answer me this?

2 点作者 markcrazyhorse超过 10 年前
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.

4 条评论

informatimago超过 10 年前
1- geolocation must be enabled by the user.<p>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).<p>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.<p>Once you have wifi enabled, it is possible to use it to scan close users directly, without using geolocation, by mere physical closeness.<p>You can also do that with bluetooth for closer distances.<p>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.
评论 #8851965 未加载
raooll超过 10 年前
Hi,<p>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.<p>This should help you <a href="http://www.elasticsearch.org/guide/en/elasticsearch/referenc.." rel="nofollow">http:&#x2F;&#x2F;www.elasticsearch.org&#x2F;guide&#x2F;en&#x2F;elasticsearch&#x2F;referenc...</a>.<p>The second option is to use mongodb for the same, but the first solution is much easier and faster to implement.
hackerboos超过 10 年前
You&#x27;re looking for PostGIS or another GIS solution.<p>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超过 10 年前
You need to post this question to Stackoverflow (www.stackoverflow.com).
评论 #8851639 未加载