social_login_plugin
Firebase Social Login Plugin is a Flutter package that simplifies social login integration into your Flutter applications using Firebase Authentication. With this plugin, you can easily implement social login functionality for Google, Facebook, and Apple accounts without the need to handle complex authentication flows separately.
AUTH support
Feature/platform | Android | iOS | Web | macOS | Windows | Linux |
---|---|---|---|---|---|---|
✓ | ✓ | ✓ | ✓ | ✓ (1) | ✓ (1) | |
Phone | ✓ | ✓ | ✓ | ╳ | ╳ | ╳ |
Email link | ✓ | ✓ | ╳ | ╳ | ╳ | ╳ |
Email verification | ✓ | ✓ | ✓ (2) | ✓ (2) | ✓ (1) | ✓ (1) |
Sign in with Apple | ✓ | ✓ | ✓ | ✓ | ╳ | ╳ |
Google Sign in | ✓ | ✓ | ✓ | ✓ | ✓ (1) | ✓ (1) |
Twitter Login | ╳ | ╳ | ╳ | ╳ | ╳ | ╳ |
Facebook Sign in | ✓ | ✓ | ✓ | ✓ | ╳ (1) | ╳ (1) |
- No deep-linking into app, so email verification link opens a web page
Getting Started
Connecting Your Flutter App to Firebase
To connect your Flutter app to Firebase, follow these steps:
Step 1: Create a Firebase Project
- Go to the Firebase Console.
- Click on "Add project" and follow the setup instructions to create a new Firebase project.
- Once your project is created, you'll be redirected to the project dashboard.
Step 2: Register Your App with Firebase
For Android:
- Click on the Android icon to add an Android app to your project.
- Enter your Android package name (usually found in your Flutter project's
android/app/build.gradle
file). - Optionally, you can also provide other details like App nickname and debug signing certificate SHA-1.
- Click "Register app" to download the
google-services.json
file.
Official Documentation for Android Setup
For iOS:
- Click on the iOS icon to add an iOS app to your project.
- Enter your iOS bundle ID (usually found in your Flutter project's
ios/Runner.xcodeproj/project.pbxproj
file). - Optionally, you can also provide other details like App nickname.
- Click "Register app" to download the
GoogleService-Info.plist
file.
Official Documentation for iOS Setup
Step 3: To use the Social Login Plugin in your Flutter project, add it to your pubspec.yaml
file:
dependencies:
social_login_plugin: ^0.0.4
Step 4: Initialize Firebase before using any social login functionalities:
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await SocialLoginPlugin().iniFirebase();
runApp(MyApp());
}
Sign In with Google
var googleData = await SocialLoginPlugin().signInWithGoogle();
Sign In with Facebook
var facebookData = await SocialLoginPlugin().signInWithFacebook();
Sign In with Apple
var appleData = await SocialLoginPlugin().signInWithApple();