Skip to content

Facebook login allows users to authenticate using their Facebook Accounts.

Adding Facebook sign-in

Adding Facebook sign-in comprises the following steps:

  1. Create app on Facebook
  2. Configure app on Facebook
  3. Add email permission
  4. Enabling Facebook authentication in Firebase
  5. Enabling Facebook authentication in FlutterFlow Studio
  6. Add a Facebook sign-in button
  7. Add login action
  8. Add logout action
  9. Prepare to test the app
  10. Verify user creation

1. Create app on Facebook

When you create an app on the Facebook Developer Console, you are given a unique App ID and App secret, ensuring secure communication between your app and Facebook’s servers. Additionally, it lets you define required permissions and user data access and also restricts login origins for enhanced security.

Here’s is how you create app on Facebook:

2. Configure app on Facebook

Now, you must add and configure platforms that will support Facebook authentication - For example, Android and iOS.

To do so follow the steps below:

3. Add email permission

When users log in using third-party providers (like Google or Facebook), fetching their email addresses reduces the steps they need to take during sign-up. For Facebook sign-in, to access a user’s email, you must add email permission in Firebase developer console.

Here’s how you do it:

4. Enabling Facebook authentication in Firebase

Here’s how you enable Facebook auth in Firebase:

5. Enabling Facebook authentication in FlutterFlow Studio

To enable the Facebook authentication in FlutterFlow Studio, follow the steps below:

6. Add a Facebook sign-in button

To allow users to authenticate, you need a login page with a button. You can create your own or use the one from the widget template or page template.

7. Add login action

When you click the sign-in button, it will trigger the ‘Log In’ action, prompting users to provide their Facebook credentials.

8. Add logout action

To let users log out of your app, you can use the Logout action.

9. Prepare to test the app

Facebook Sign-In functionality does not work in Run or Test Mode. You can test your app on a real device or emulator using FlutterFlow Studio’s Local Run. Follow the Local Run documentation and see how to set up a physical device to start testing.

10. Verify user creation

To confirm the successful integration and the creation of users, navigate to your Firebase project > Authentication > Users and check the user entries.

Last updated on