3 回答

TA貢獻1820條經驗 獲得超9個贊
Firebase身份驗證會話在iOS鑰匙串中保留在用戶設備上。卸載應用程序時,不會刪除該應用程序的鑰匙串數據。
如果要手動清除數據,則可以將一些其他元數據與應用程序一起存儲,并手動調用FirebaseRef.unauth()以清除持久化的會話。請參閱#4747404:在卸載應用程序時刪除鑰匙串項,以獲取其他參考。

TA貢獻1859條經驗 獲得超6個贊
在AppDelegate的didFinishLaunchingWithOptions函數(在返回true之前)的末尾添加以下代碼可以快速進行。
let userDefaults = NSUserDefaults.standardUserDefaults()
if userDefaults.valueForKey("appFirstTimeOpend") == nil {
//if app is first time opened then it will be nil
userDefaults.setValue(true, forKey: "appFirstTimeOpend")
// signOut from FIRAuth
do {
try FIRAuth.auth()?.signOut()
}catch {
}
// go to beginning of app
} else {
//go to where you want
}

TA貢獻1796條經驗 獲得超10個贊
對于快速4相同的答案:
let userDefaults = UserDefaults.standard
if userDefaults.value(forKey: "appFirstTimeOpend") == nil {
//if app is first time opened then it will be nil
userDefaults.setValue(true, forKey: "appFirstTimeOpend")
// signOut from FIRAuth
do {
try Auth.auth().signOut()
}catch {
}
// go to beginning of app
} else {
//go to where you want
}
- 3 回答
- 0 關注
- 709 瀏覽
添加回答
舉報