gpt4 book ai didi

swift - 使用未解析的标识符 'Auth'

转载 作者:搜寻专家 更新时间:2023-10-31 22:04:11 25 4
gpt4 key购买 nike

我一直收到这个错误

Use of unresolved identifier 'Auth'

enter image description here

Auth.auth().createUser(withEmail: email, password: password) { (user, error) in

let ref = Database.database().reference(fromURL: "https://app-project.firebaseio.com")
let usersReference = ref.child("Users")
let id = usersReference.childByAutoId().key

InstanceID.instanceID().instanceID(handler: { (result, error) in
let token = result?.instanceID
let values = ["phone": phone,"CreatedAt":dateString,"UpdatedAt":dateString,"id":id as Any,"token":token as Any] as [String : Any]
usersReference.child(id!).setValue(values, withCompletionBlock: { (err, ref) in
if err != nil {
print(err.self as Any)
return
}
print("Successfully saved user in Firebase DB")

})

})

}

播客文件

platform :ios, '10.0'
use_frameworks!

target 'project' do
pod 'Charts'
pod 'SwiftyJSON'
pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'Firebase/Database'
pod 'Firebase/Auth'
end

我已经在我的文件上使用了它

import Firebase
import FirebaseDatabase

我试着重建,仍然看到它。

重新启动 XCode,重建仍然可以看到它。

如何进一步调试它?

最佳答案

你需要

import FirebaseAuth

关于swift - 使用未解析的标识符 'Auth',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53658161/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com