更新时间:2023-11-28 07:56:28
您可以使用UserDefault
进行检查.只需维护该标志即可检查
You can use UserDefault
to check the same. Just maintain the flag to check
喜欢
GIDSignIn.sharedInstance().signInSilently()
Auth.auth().addStateDidChangeListener { (auth, user) in
if user != nil {
if UserDefaults.standard.string(forKey: "uid") != nil && Auth.auth().currentUser != nil {
//User was already logged in
}
UserDefaults.standard.setValue(user?.uid, forKeyPath: "uid")
self.performSegue(withIdentifier: "CurrentlyLoggedIn", sender: nil)
}
}