swift - 在 Swift 4 中退出 Firebase

标签 swift xcode firebase compiler-errors logout

这个问题在这里已经有了答案:





Firebase - Deleting and reinstalling app does not un-authenticate a user

(4 个回答)


2年前关闭。




使用firebase登录后,我想从我的应用程序中注销,我在我的应用程序中尝试了此代码,但它不起作用。

print("clickSignOut")
        do {
            try Auth.auth().signOut()
       } catch {
         print("can't signOut")strong text
       }
      print(Auth.auth().currentUser ?? "no user")

最佳答案

这总是对我有用:

do {
    try Auth.auth().signOut()
} catch let error {
    print("Error: ", error.localizedDescription)
}

如果这对您不起作用,请为我们提供更多背景信息。 “它不起作用”是什么意思?如果您使用提供的此代码,它将告诉您遇到了什么错误。

关于swift - 在 Swift 4 中退出 Firebase,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58806982/

相关文章:

ios - dismissViewControllerAnimated 自定义动画

ios - 将数据传递给导航 Controller 中的另一个 View Controller

iOS 8.1 Swift UIActivityViewController 不显示社交媒体共享(Facebook、twitter、WhatsApp 等)

ios - 删除搜索栏中的取消按钮背景色

ios - 通过 Firebase 推送通知不会出现在后台应用程序的 iOS 上

ios - SceneKit - 绘制 3D 抛物线

xcode - Swift 和 Parse(以及 xCode)问题

ios - Texturetool 在 Unity3d 中转换翻转的 pvr 文件

swift - "Missing required module"当 pod 库仅安装在一个 Target 中时

javascript - 带有 Firebase ML 套件的 Nativescript Js OCR