Firebase kicks out current user

前端 未结 14 1782
一个人的身影
一个人的身影 2020-11-22 01:42

So I have this issue where every time I add a new user account, it kicks out the current user that is already signed in. I read the firebase api and it said that \"I

14条回答
  •  借酒劲吻你
    2020-11-22 02:00

    Here is a Swift 3 adaptaion of Jcabrera's answer :

    let bundle = Bundle.main
            let path = bundle.path(forResource: "GoogleService-Info", ofType: "plist")!
            let options = FIROptions.init(contentsOfFile: path)
            FIRApp.configure(withName: "Secondary", options: options!)
            let secondary_app = FIRApp.init(named: "Secondary")
            let second_auth = FIRAuth(app : secondary_app!)
            second_auth?.createUser(withEmail: self.username.text!, password: self.password.text!)
            {
                (user,error) in
                print(user!.email!)
                print(FIRAuth.auth()?.currentUser?.email ?? "default")
            }
    

提交回复
热议问题