Skip to content

Instantly share code, notes, and snippets.

@manuelernesto
Last active January 16, 2019 08:16
Show Gist options
  • Save manuelernesto/479cb03a1778b4ebbc730365485a661e to your computer and use it in GitHub Desktop.
Save manuelernesto/479cb03a1778b4ebbc730365485a661e to your computer and use it in GitHub Desktop.
var db = FirebaseFirestore.getInstance()
val mPersonTable: CollectionReference = db.collection("Person")
val person = Person(
null,
etName_firestore.text.toString(),
etEmail_firestore.text.toString(),
etPhone_firestore.text.toString())
mPersonTable.add(person)
.addOnSuccessListener {
"Thanks for your subscription.".toast(this@FirestoreActivity)
}
.addOnFailureListener { exception ->
"Error: ${exception.message}".toast(this@FirestoreActivity)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment