I am following the Firebase docs: https://firebase.google.com/docs/auth/ios/phone-auth
in an attempt to Authenticate with Firebase on iOS using a phone number and I am getting a fatal crash when it reaches here in my code:
PhoneAuthProvider.provider().verifyPhoneNumber(self.phoneNumberTextField.text!, uiDelegate: nil) { (verificationID, error) in
if let error = error {
print("error: \(error.localizedDescription)")
return
}
// Perform Seque to VerifictionCodeViewController
self.performSegue(withIdentifier: "enterVerificationCode", sender: self)
}
The error is : libc++abi.dylib: terminating with uncaught exception of type NSException
in my appDelegate.swift file.
If I use the older and 'deprecated' version of the function
PhoneAuthProvider.provider().verifyPhoneNumber(self.phoneNumberTextField.text!) { (verificationID, error) in
if let error = error {
print("error: \(error.localizedDescription)")
return
}
// Perform Seque to VerifictionCodeViewController
self.performSegue(withIdentifier: "enterVerificationCode", sender: self)
}
without the new added uiDelegate: nil
portion in the verifyPhoneNumber
function, everything works fine!?
Has anyone been able to resolve this??