Find nearby users of an app (iPhone and Android)

前端 未结 4 434
野性不改
野性不改 2021-02-01 19:23

I am working on an app that has an iPhone version as well as an Android version.

My goal is...

  • display a list of nearby users of my app (iPhone app users
相关标签:
4条回答
  • 2021-02-01 19:58

    You should also take a look at scringo . It's an SDK & service that has this exact feature (find nearby users of your app + show it on map, etc...)

    0 讨论(0)
  • 2021-02-01 20:05

    Even i had this question on my mind today while creating similar app. Alert when two users/friends are near to each other - Android Proximity

    after spending a couple of hours thinking, I thought a better way to do this :

    1) Create SharedPreference / DB which holds the last Coordinates of the device which was also updated to the server.

    2) Create Service which will fire once in 15 minutes requesting current location.

    3) If the current location matches the Last Location retrieved from the SharedPreference and or around within proximity (depends on how much u give 30ft or more) then user is in the same place so don't upload the coordinates to the server.

    4) If the user isn't within proximity or last location doesn't match current location then upload the coordinates to the server.

    5) After uploading coordinates to the server, update SharedPreference too..

    6) After uploading, return response of Users details from the server who are nearby the same coordinates. The User will then get notified if someone around them..

    0 讨论(0)
  • 2021-02-01 20:06

    you should consider following possible issues.

    1. If application keep on sending user's location then the user battery will getting down, and web server memory will increase.

    2. Application will keep on use internet to send location to web server.

    3. At the time of roaming internet data cost may increase.

    my suggestions:

    1. The app should send the user's location every 15 minutes.

    2. Every application should use unique id to update their location.

    3. If application closed then clear that app's location in web server.

    0 讨论(0)
  • 2021-02-01 20:09

    Every update you do will cost battery and data. If you do this too much, you will certainly annoy users by being a resource hog.

    I'd suggest creating a service that is called periodically, to update the user's location on the server, and get a list of nearby users from the web server. The frequency of updates should depend on the speed the user was traveling at during their last update. If they weren't moving, 15 minutes is probably alright, if they were going at car speeds, more often is necessary.

    In order to store the users locations on the web server, I'd suggest using a purpose built GIS package that actually understands what a location coordinate is. Most databases have something like this built in. Then, when the app requests a list of nearby users, the app only needs to receive the users that are actually nearby, and the others can be ignored, saving some data, and the work of doing distance calculations on the phone.

    0 讨论(0)
提交回复
热议问题