![Mastering Firebase for Android Development](https://wfqqreader-1252317822.image.myqcloud.com/cover/713/36699713/b_36699713.jpg)
上QQ阅读APP看书,第一时间看更新
Project configuration
Go to Firebase console and inside the authentication window, go to sign-in method and enable phone number sign- in. Now, we need to add the phone number provider inside the getAuthProviderList method:
private List<AuthUI.IdpConfig> getAuthProviderList() {
List<AuthUI.IdpConfig> providers = new ArrayList<>();
providers.add(
new AuthUI.IdpConfig.Builder(AuthUI.EMAIL_PROVIDER).build());
providers.add(new
AuthUI.IdpConfig.Builder(AuthUI.GOOGLE_PROVIDER).build());
providers.add(new
AuthUI.IdpConfig.Builder(AuthUI.FACEBOOK_PROVIDER).build());
providers.add(new
AuthUI.IdpConfig.Builder(AuthUI.TWITTER_PROVIDER).build());
providers.add(new
AuthUI.IdpConfig.Builder(AuthUI.PHONE_VERIFICATION_PROVIDER).build());
return providers;
}
Now that we have successfully integrated phone number verification into the application, let's compile the output:
![](https://epubservercos.yuewen.com/E46BFC/19470391708875606/epubprivate/OEBPS/Images/Chapter_15.jpg?sign=1739260724-wcL1Q1wQDuXtX24TOt5GyhUiFovxE8XN-0-eac8cbda2350d0984eaceb837f49253d)
This screenshot shows the successful integration of the FirebaseUI for phone number sign-in.