我使用Firebase和Swift進行與Instagram的自定義身份驗證。觀察者的完成處理程序未調用,如何檢入代碼
我現在有這個問題,Remove a user through dashboard, but the user is still logged in?
當我啓動應用程序,我有這樣的監聽器:
Auth.auth().addStateDidChangeListener {
在我設置一個觀察者:
ref.child("users/\(user.uid)").observe(.value, with: { (snapshot) in
print(snapshot)
..........
}, withCancel: { error in
print(error)
})
with
和withCancel
處理程序不會執行,因爲用戶的令牌不再存在。 (非常奇怪的IMO,即使withCancel
不執行)。
我要趕在代碼這種情況下,強制註銷,像帖子說:你
檢查是否可以讀取你的用戶區域,如果有什麼都沒有,強制註銷。