Associate Geofire location with Firebase entry

廉价感情. 提交于 2020-02-03 04:38:08

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!