3

I want to create an app that allows a user to find the nearby other users location using GPS coordinates who are Logged in to the same app .Also it can be track the location of the devices(Logged in to the same app) which are moving in a car .

Can someone give me an overview of how I can accomplish this. is there any free API available to accomplish this task.

zvisofer
  • 1,346
  • 18
  • 41
Siba Prasad Hota
  • 4,779
  • 1
  • 20
  • 40
  • 2
    You are probably going to need a web service that stores locations of devices when the app is running, then from your app send a query to the webservice that returns devices within a range. – danielbeard May 03 '12 at 00:35
  • Hi Danielbeard thanks for your reply and suggestion.can you please explain me how to send a query that returns devices within a range ? that means if i have the coordinates of all the users then,how i know that which device is near by ? – Siba Prasad Hota May 03 '12 at 00:57
  • +1 - Good question - I'm looking for something similar. – Cyclonecode Jul 20 '13 at 00:15
  • I had thought to take this approach, storing users last known location when they log in to the app or it updates every hour or so while running. But what I am not sure of is say I have a database with users GPS locations (I assume that's what I'll get from iOS location services?)... how can I determine based on two GPS locations, how far they are apart? Is there an algorithm I can use? Do I have to call an external API? If I have 10000 users then that's 10,000 calls to an external API which would be far too slow to be usable so there must be a way. How does Tinder/Grindr do it? – NZJames Feb 19 '14 at 12:07
  • Hi @user1122909, Make sure all the device running your app has updated their location to your database in a period of time. Then you jist need to write a qyerry to get all the devices as per their location with some radious. – Siba Prasad Hota Feb 20 '14 at 09:57

2 Answers2

4

Danielbeard is correct - you would need to be continually storing/updating locations on a server somewhere. Your app does get some running time when it is in the background, but I'm not sure it would be enough to run the web traffic that you'd need.

Check out this post: Running app in background and send frequent http request

And check out the multitasking guide here: Multitasking Guidelines

You can also look at Push Notifications. Hopefully this helps.

Community
  • 1
  • 1
Ian
  • 3,806
  • 2
  • 20
  • 23
2

In iOS7 MultiPeerConnectivity was introduced to find near by applications, so if you have a coffee shop and someone walks by or in they could get the latest deals, or, you walk into a room and the music changes to what you like as your device exchanges information with another.

http://nshipster.com/multipeer-connectivity/

James Black
  • 41,583
  • 10
  • 86
  • 166