ios - Firebase 引用的是旧项目而不是当前项目

标签 ios swift firebase

在我的新项目中,我使用以下代码确保用户不必每次打开应用程序时都转到登录屏幕:

// this means that there is a user logged in... take them to the main view.
    if let x = FIRAuth.auth()?.currentUser?.uid {
        print("The current user is: \(x)")
        // first param is storyboard name
        self.setTheRootViewController("Main", identifier: "GroupChatsView")
    }
    // take them to the login view controller
    else {
        self.setTheRootViewController("Main", identifier: "LoginView")
    }

我还没有创建任何用户,所以我希望这段代码每次都能带我进入登录 View 。但是,出于某种奇怪的原因,当我打印出当前用户的唯一 ID 时,它是我自己在以前的项目中的唯一 ID。我不知道此时该怎么办。此外,我的 GoogleService-Info.plist 中的所有内容都与我的新项目相匹配。

当我在 iOS 模拟器中注销其他应用程序时,代码按预期运行。

有没有简单的解决方法?谢谢。

最佳答案

在你的模拟器中清理并重置设置!它确实有效。

关于ios - Firebase 引用的是旧项目而不是当前项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37819532/

相关文章:

swift - 在 Swift 中将 UITextField 转换为字符串

ios - 访问 UIWindow XCode UITesting 上的元素

ios - swift 字典中的 "Extract"数组

android - Firebase 身份验证和数据库加密

IOS:Convert hex values from the characters.value 结果

3d 动画的 ios 问题

android - 通过 Firebase 中的 InstallReferrerReceiver 跟踪 Android 应用安装

firebase - 如何在Firebase中的文档中添加多个字段?

ios - Xcode - 保存按钮点击顺序并按保存顺序重播操作?

ios - xcode 5 中的代码签名错误配置文件