Firebaseui-ios: How to present the FUIPhoneAuth without showing the welcome screen with the 'Sign in with phone' button?

Created on 19 Jun 2017  路  3Comments  路  Source: firebase/FirebaseUI-iOS

When I present the authViewController, it displays a screen with a button to 'Sign in with phone'. Is it possible to bypass this screen, and go straight to the 'Enter Phone Number' screen?

Specs:

  • Swift
  • iOS version: 10.3
  • Firebase iOS version: 4.0.2
  • FirebaseUI version: 4.0.0
let authUI = FUIAuth.defaultAuthUI()
// You need to adopt a FUIAuthDelegate protocol to receive callback
authUI?.delegate = self
authUI?.isSignInWithEmailHidden = true


let providers: [FUIAuthProvider] = [
    FUIPhoneAuth(authUI:FUIAuth.defaultAuthUI()!)
]

authUI?.providers = providers

let authViewController = authUI?.authViewController()

self.present(authViewController!, animated: true) { }

Most helpful comment

Swift

let auth = FUIAuth.defaultAuthUI()
auth?.delegate = self
let phoneAuth = FUIPhoneAuth(authUI: auth!)
auth?.providers = [phoneAuth]
phoneAuth.signIn(withPresenting: self)

All 3 comments

@pete183 Yes, here is my objective-c code snippet:

    FUIAuth *auth = [FUIAuth defaultAuthUI];
    auth.delegate = self;

    FUIPhoneAuth *phoneAuth = [[FUIPhoneAuth alloc] initWithAuthUI:auth];
    auth.providers = @[phoneAuth];
    [phoneAuth signInWithPresentingViewController:viewController];

Swift

let auth = FUIAuth.defaultAuthUI()
auth?.delegate = self
let phoneAuth = FUIPhoneAuth(authUI: auth!)
auth?.providers = [phoneAuth]
phoneAuth.signIn(withPresenting: self)

update for swift 3.1

let auth = FUIAuth.defaultAuthUI()
auth?.delegate = self as? FUIAuthDelegate
let phoneAuth = FUIPhoneAuth(authUI: auth!)
auth?.providers = [phoneAuth]
phoneAuth.signIn(withPresenting: self)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

platoputhur picture platoputhur  路  4Comments

SamboVisal picture SamboVisal  路  5Comments

willbattel picture willbattel  路  6Comments

georgstrieder picture georgstrieder  路  7Comments

morganchen12 picture morganchen12  路  7Comments