Last active
September 18, 2021 06:31
-
-
Save a914-gowtham/632886cd49ff445b4eb7582e2c86c372 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun insertUser(){ | |
val mobileNumber= MobileNumber("+91","9876543210") | |
val profile = UserProfile( | |
uId= userId, | |
image = "https://i.pravatar.cc/150?img=2", | |
userName = "otis", | |
mobile = mobileNumber, | |
token = "el3LZrv0QmK5k-vjoO970:APA91bF8XKRqqTmf2n7E2PUrVDaxvhxq3WAIwQ5sHqLkwGbiICkebrCpkpwJvrVrvcJiDgaeLndJQwJDWvv2ad-W0SGDpDyuYgrQGFo5eDQSvce20gS1Q5ijmkD-QmzBAgFoRVaDi2u", | |
) | |
val db = FirebaseFirestore.getInstance() | |
db.collection("Users").document(profile.uid) | |
.set(profile, SetOptions.merge()) | |
.addOnSuccessListener { Log.d(TAG, "DocumentSnapshot successfully written!") } | |
.addOnFailureListener { e -> Log.w(TAG, "Error writing document", e) } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment