Search code examples
iosswiftfirebasegeofire

Is there a way to manually enter locations in Geofire through Firebase web?


I made an app that uses the user location, but I need my client to manually enter the locations through their coordinates. I haven't been able to do this since GeoFire uses a unique code as part of the location parameter.

Is there a way to enter a location without this code, or determine how to construct this code manually?

Miami  
 g: "dhwfxhhf02" //This is the unique code.
 l:
   0: 25.77427 //These are the only parameters I would need. And would like to input them directly in Firebase.com
   1: -80.19366

Thanks!


Solution

  • That unique code is the so-called "GeoHash" and it's what makes GeoFire tick.

    It's automatically generated when you use the GeoFire API, such as with:

    geoFire.setLocation(CLLocation(latitude: 37.7853889, longitude: -122.4056973), forKey: "firebase-hq")
    

    If you need to provide a web interface for your users, you can just use GeoFire for JavaScript in a web page and call set() on there. See https://github.com/firebase/geofire-js/blob/master/docs/reference.md#geofiresetkeyorlocations-location