I am developing a chatting app which has groups sections where it shows all groups in firebase firestore.
here is my data collection:
and inside Group i have:
can anyone guide me how to get all Group from firestore? in realtime database i did that but could not get along in firestore:
DataService.instance.REF_GROUPS.observe(.value) { (snapshot) in
DataService.instance.getAllMessagesFor(desiredGroup: self.group!, handler: { (returnedGroupMessages) in
self.groupMessages = returnedGroupMessages
self.tableView.reloadData()
if self.groupMessages.count > 0 {
self.tableView.scrollToRow(at: IndexPath(row: self.groupMessages.count - 1, section: 0), at: .none, animated: true)
}
})
}