2

I am following the official firebase authentication documentation for swift available here:

I am trying to log the user in using a verification a code sent to their device. (using reCAPTCHA verification)

https://firebase.google.com/docs/auth/ios/phone-auth, and I get this the error: "Type 'FirebaseAuth' has no member 'showTextInputPrompt'"

enter image description here Image containing the code snippet causing the error.

I just want to know more about this ".showTextInputPrompt" and where it comes from.

1 Answer 1

4

showTextInputPrompt is not a member of FirebaseAuth. It's a member of the view controller from the example that code snippet is taken from. See the full code at https://github.com/firebase/quickstart-ios/blob/master/authentication/LegacyAuthQuickstart/AuthenticationExampleSwift/MainViewController.swift

UPDATE

I've updated the quickstart with a Swift implementation of showTextInputPrompt. See https://github.com/firebase/quickstart-ios/blob/master/authentication/LegacyAuthQuickstart/AuthenticationExampleSwift/UIViewController.swift.

4
  • What swift version is that? because I have tried to access that function using the UIViewController, but it is not being recognized?!
    – Lenda
    Apr 18, 2020 at 18:17
  • 1
    It's defined locally in that project. The Swift MainViewController extends an Objective C implementation where it's implemented at github.com/firebase/quickstart-ios/blob/master/authentication/… Apr 18, 2020 at 20:18
  • Updated the answer with a pointer to a new Swift implementation. Apr 21, 2020 at 15:06
  • The links are broken
    – Bernard
    Feb 25, 2021 at 22:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.