Facebook authentication in Android
In case you created an Android application before, you might already have heard or know about the Facebook authentication, but in this recipe, we're going to cover how we can integrate Facebook OAuth using the Firebase UI Auth library.
Getting ready...
Before we start coding our application, let's install some dependencies. Go to your build.gradle
file and paste in the following entry:
compile 'com.firebaseui:firebase-ui-auth:3.0.0' compile 'com.facebook.android:facebook-login:4.27.0'
Now simply save and sync your project; what will happen next is that Android Studio will download and configure your project accordingly with the new dependency.
How to do it...
To save you the hassle of creating the connection button and wiring the button and metadata, Firebase offers the powerful Firebase UI for Android, where it will help us create the basic UI and wire up everything for us out of the box. So let's see how we can make it happen.
- In your login activity...