Firestore addSnapshotListener Example

May 15, 2019
docRef.addSnapshotListener { doc, e ->
    if (doc != null) {
        if (doc.exists()) {
            // do something
        }
        else {
            // do something
        }
    }
    else {
        e!!.printStackTrace()
    }
}
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.