I am trying to integrate Geofire into a Firebase Objective-C app, but I'm not sure how to set up the Geofire node to observe my Firebase storage base. Here is what the Geofire start-up guide advises:
"To create a new GeoFire instance you need to attach it to a Firebase database reference"
My question is: What does it mean to "attach it to a Firebase database reference"?
In my code I would like Geofire to observe this Firebase location:
@"https://myApp.firebaseio.com/ios/languages"
Here is what the "languages" node looks like in Firebase:
languages
--Arabic
----FakeUser1
------latitude: "38.8438"
------longitude: "-77.62432"
----FakeUser2
------latitude: "38.6438"
------longitude: "-77.32432"
--English
----FakeUser1
------latitude: "38.3438"
------longitude: "-77.92432"
----FakeUser2
------latitude: "38.2438"
------longitude: "-77.02432"
What I'd like to know is how to get Geofire to observe and store the locations of each fake user. Do I create a unique Geofire node and read users into it whenever I read users into the /languages/arabic or /languages/english references? Or will Geofire observe the pre-existing node--ie. will something like this do the trick:
Firebase *geofireRef = [[Firebase alloc] initWithUrl:@"https://myApp.firebaseio.com/ios/languages"];
GeoFire *geoFire = [[GeoFire alloc] initWithFirebaseRef:geofireRef];