问题
So, I have an Android app that lets users view posts within a certain radius of their current location. I am storing the posts using firebase, but I couldn't find a way to query for posts within a specific radius in firebase, so now I am thinking of using geofire, but I am not sure if there is a way to store a location alongside my firebase posts using geofire, so, it would seem to me like the only way to associate a location with a post is to have the post id (the one generated by firebase) be the key for the geofire location. Is this correct or is there a better way?
回答1:
Yes, that the correct way. You create a flat DB. One branch with post data and one branch with locations.
来源:https://stackoverflow.com/questions/33885733/associate-geofire-location-with-firebase-entry