I'm trying to understand back end development with Firebase in SwiftUI, I have developed a small application in which we can actually login with Firebase Auth. I would like to display a pop-up when the user logs in for the first time, Firebase doesn't have a function already done for that so I would like to code one but where to start?
I wanted to get the UID of the user when he logs in and put it in the "user_data" database if it wasn't already there otherwise ignore the rest of my function. If it is not there then display a pop-up in which he can choose a flag that will be assigned to him (for example a city) and then display the restaurants in his city for example.
The question may seem silly but I am new to this field and I would like to improve because it interests me a lot and seeks to understand and document me as much as possible on the back end of swiftUI.
Thank you for your precious help and advice.
Auth.auth().signIn(with: credential) { (result, error) in
if error == nil{
if result?.additionalUserInfo!.isNewUser == true{
//is a new user
}
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.