2017-09-27 72 views
-1

我試圖在我的iOS應用程序中爲Phone Authentication實施FirebaseUI。但是,這打開了用戶界面會顯示「登錄與郵件」選項FirebaseUI直接在iOS應用程序中使用FirebaseUI登錄電話

我需要它,直接進入手機登錄頁面級 Phone Login

如何在FirebaseUI來完成。另外,如何在出現此視圖之前填寫電話號碼字段?

回答

0

你應該在你的代碼中的某個地方創建了一個類型爲FUIAuth的對象,或許在視圖控制器中。

// Perhaps you made it by doing this. 
let authUI = FUIAuth.defaultAuthUI() 

// You should also have a `FUIPhoneAuth` object somewhere. 
let phoneProvider = FUIPhoneAuth(authUI: authUI) 

// This will suppress the "Sign in with mail button" 
authUI.isSignInWithEmailHidden = true 

// This will bypass that welcome screen altogether 
// (because there is only a single element in the array). 
authUI.providers = [phoneProvider] 

如果你已經知道電話號碼,你可以這樣做。假設self是呈現Firebase UI的視圖控制器。

let phoneNumber = "+12345558888" 
phoneProvider.signIn(withPresenting: self, phoneNumber: phoneNumber) 
相關問題