I kept getting this error
Use of unresolved identifier 'Auth'
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")
})
})
}
Podfile
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
I already use this on top of my file
import Firebase
import FirebaseDatabase
I tried to rebuild, still seeing it.
Restart XCode, rebuild still seeing it.
How would one go about debugging this further?
You need to
import FirebaseAuth
let include 'Firebase/Auth' in you pod file.Then type in your terminal pod install.Then import FirebaseAuth.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With