Start a Project

Facebook Sign in Flutter

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.

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.

Finally, run your code and check the result.

Thanks for reading 🙂

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

Exit mobile version