0

I am using a firebaseUI multiple login all buttons are generating except Facebook Builder().build()

How to inflate that button

Anurag Tiwari
  • 115
  • 1
  • 10

1 Answers1

0

add the list of supported providers as follows :

 List<AuthUI.IdpConfig> providers = Arrays.asList(
            new AuthUI.IdpConfig.GoogleBuilder().build(),
            new AuthUI.IdpConfig.FacebookBuilder().build(),
            new AuthUI.IdpConfig.TwitterBuilder().build(),
            new AuthUI.IdpConfig.PhoneBuilder().build());

and then you create the sign in intent :

   Intent intent = AuthUI.getInstance()
            .createSignInIntentBuilder()
            .setAvailableProviders(providers)
            .build();

call startActivityForResult() with 'intent'

Edit :

You need to add the following dependencies to your app level gradle file :

 implementation 'com.firebaseui:firebase-ui-auth:6.2.1'
 implementation 'com.facebook.android:facebook-android-sdk:5.15.1'

Note that you don't need the firebase auth dependency because it's included in the firebase-ui dependency

ahmed osama
  • 560
  • 1
  • 7
  • 13
  • I dont undertand the logic – Anurag Tiwari Apr 22 '20 at 18:14
  • showing error ` Intent intent = AuthUI.getInstance() .createSignInIntentBuilder() .setAvailableProviders(providers) .setLogo(R.drawable.logo) .setTheme(R.style.LoginTheme) .setTosAndPrivacyPolicyUrls( "https://example.com/terms.html", "https://example.com/privacy.html") .build(); //startActivityForResult(intent); //showSignInOptions(); startActivityForResult(intent,MY_REQUEST_CODE);` – Anurag Tiwari Apr 22 '20 at 18:23
  • i am not able to upload code over here can you please share your email id so that i can send you the code – Anurag Tiwari Apr 22 '20 at 18:27
  • showing error means when i add FacebookBuilder().build() it stops the app without this line app works fine – Anurag Tiwari Apr 22 '20 at 18:28
  • make sure you have the facebook dependency – ahmed osama Apr 22 '20 at 18:33
  • i have already these dependencies //Firebase implementation 'com.google.firebase:firebase-core:16.0.6' implementation 'com.firebaseui:firebase-ui-auth:6.2.0' //Facebook implementation 'com.facebook.android:facebook-android-sdk:[5,6)' implementation 'com.facebook.android:facebook-android-sdk:5.15.1' – Anurag Tiwari Apr 22 '20 at 18:34
  • can you please provide the code for all your dependencies as well as the sign in intent as an edit to the original question – ahmed osama Apr 22 '20 at 18:41
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/212292/discussion-between-anurag-tiwari-and-ahmed-osama). – Anurag Tiwari Apr 22 '20 at 18:47
  • please send your email id – Anurag Tiwari Apr 22 '20 at 18:49
  • sir i add all code over here this post https://stackoverflow.com/questions/61373084/i-am-using-firebase-ui-login-into-my-app-but-when-i-use-facebook-builder-it-stop – Anurag Tiwari Apr 22 '20 at 19:05