0

Im trying to make an iphone app like google latitude or find my friends. I'm able to find my current location but how do i locate my friends? And also how do i show that location on the map?

Anoop Vaidya
  • 46,283
  • 15
  • 111
  • 140
Rach92
  • 21

1 Answers1

0

You can refer here to know about getting user current location.

- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {
    NSLog(@"OldLocation %f %f", oldLocation.coordinate.latitude, oldLocation.coordinate.longitude);
    NSLog(@"NewLocation %f %f", newLocation.coordinate.latitude, newLocation.coordinate.longitude);
}

You Must need a web service that stores locations of each devices when the app is running, then from your app send a query to the web-service from there you will find the list of device using the app.

It's not a very elegant solution since the user is always polling the server and the web request can fail more often than you'd want. I heard about socket programming where the user keeps a live connection to the server and when ever the server changes, the user is notified, sounds more like the right approach but also sounds much harder :P

see my answer here For Showing Multiple annotation on MAP.

Community
  • 1
  • 1
Siba Prasad Hota
  • 4,779
  • 1
  • 20
  • 40
  • Is there any other way to do this? in another words, Are there any api's available in google maps for IOS ? – 2vision2 May 14 '14 at 13:53