Andrea Culot Andrea Culot - 1 year ago 92
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?

Answer Source

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!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download