Request Database Data Associated with GeoFire

After reading these questions:

Associate Geofire Location with Firebase Record

Filtering Results Using Geofire + Firebase

I understand that for a given instance, location data and regular data for this object must be stored separately, and therefore I must have different listeners. The first is to find location data, and then one for each of the objects that match the location request found.

However, my question is about listeners of actual data, not location data. For example, let's say I have an application that finds a list of Restaurant objects near the user's current location. I understand that this should be done using GeoFire, but do I need to have one event listener for each of the returned snapshots to extract additional data?

To clarify, what if I want to know when any of the other aspects of the restaurants will change (rating, hours, available places)? One listener will not do this because it will not listen to the constant changes in these restaurants.

What would be the best way to do this?

+3
source share

Source: https://habr.com/ru/post/1242650/


All Articles