Facebook Sign in Flutter

Updated 18 December 2023

Facebook Sign in Flutter

Nowadays in most of the mobile app, it required login. And to log in, we need to signup first, filling the long-form. But we can log in to the app through a Social account, then we don’t need to fill a long form to register into the app. Facebook Sign in Flutter is one of the ways to log in.

Our Flutter app development company also provides various Social Login compatibility for mobile apps.

In today’s blog, we will see how we can implement Facebook Sign in Flutter.

Android Integration:

Step 1: Open Facebook Developer, log in with your Facebook credentials, and Create an App.

Step 2: You will get an AppID, and save it with you.

Facebook for Developer

Step 3: Now, copy-paste the following to your strings resource file. If you don’t have one, just create it.

<your project root>/android/app/src/main/res/values/strings.xml

Step 4: Then, copy-paste the following to your Android Manifest:

<your project root>/android/app/src/main/AndroidManifest.xml

iOS Integration:

Step 1: “Register and Configure Your App with Facebook” step in the the Facebook Login documentation for iOS site. (Note: Complete Step 1 and and Step 3 only from the documentation).

Step 2: Open Info.plist file as Source Code, copy-paste the following to your Info.plist file, before the ending </dict></plist>

Flutter Code:

Step 1: Add the below code in package’s pubspec.yaml and run pub get, then run pub get.

Step 2: Import the below packages in the main.dart file.

Step 3: For Facebook login check the below function.

Step 4: Here’s the complete code for the main.dart file.

Facebook Login Popup
Facebook Login Page

Finally, run your code and check the result.

Thanks for reading 🙂

For more interesting blogs check out here – https://mobikul.com/blog/

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*

Be the first to comment.

Start a Project

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home