Andrea Culot Andrea Culot - 3 months ago 25
iOS Question

Is possible to get the current location with Firebase (iOS)?

I read all the docs and some examples of GeoFire for Firebase but I don't understand if it's possibile to get the current location of a it possible? and if it is, how can I get it?


Geofire has a good readme at github...

Retrieving a location using Swift

geoFire.getLocationForKey("firebase-hq", withCallback: { (location, error) in
  if (error != nil) {
    println("An error occurred getting the location for \"firebase-hq\": \(error.localizedDescription)")
  } else if (location != nil) {
    println("Location for \"firebase-hq\" is [\(location.coordinate.latitude), \(location.coordinate.longitude)]")
  } else {
    println("GeoFire does not contain a location for \"firebase-hq\"")

Take a look here and here!