Firebase provides a bunch of awesome services such as Firestore, Auth, Cloud Storage, Cloud Functions and Cloud Messaging. Learn how to use them in this tutorial course in which we’re making a fully fledged real-time chat app with everything you’d expect like sending images and getting notifications when we receive a new message.
In this part you will learn how to set up the accounts of your users. We will create a User class and save it to Firestore database. We will also use Firebase Cloud Storage to save the profile picture.
This post contains all the code that’s been written in this YouTube video.
I’ve posted a problem on youtube comments
thank u for this series on kotlin and for your way in teaching …
Thanks alot
doest work at all
fun initCurrentUserIfFirstTime(onComplete: () -> Unit) {
currentUserDocRef.get().addOnSuccessListener { documentSnapshot ->
if (!documentSnapshot.exists()) {
val newUser = User(FirebaseAuth.getInstance().currentUser?.displayName ?: “”,
“”, null, mutableListOf())
currentUserDocRef.set(newUser).addOnSuccessListener {
onComplete()
}
}
else
onComplete()
}
}
type inference failed mutablelistOf
none of the following fuctions can be called with the arguments supplied
I face a problem when I press the My Account button, the application will be stopped, please answer