flutter_facebook_plugin 0.0.5 copy "flutter_facebook_plugin: ^0.0.5" to clipboard
flutter_facebook_plugin: ^0.0.5 copied to clipboard

Flutter Facebook to Log in and Sharing dialogs

flutter_facebook_plugin #

Dart package: https://pub.dev/packages/flutter_facebook_plugin

Flutter Facebook to Login and Sharing dialogs

Add easily Facebook login to your application and after succesful login call the link Facebook sharing dialog.

Getting Started #

To use this plugin, add flutter_facebook_plugin as a dependency in your pubspec.yaml file.

Setup android #

  • You need to complete Step 1
  • Skip Step 2 and Step 3

Complete Step 4. Edit Your Resources and Manifest

  • Add values to /android/app/src/main/res/values/strings.xml (create file if it doesn't exist) Remember to put your correct Facebook App Id.
<?xml version="1.0" encoding="utf-8"?>
    <string name="facebook_app_id">1234</string>
    <string name="fb_login_protocol_scheme">fb1234</string>
  • Add a meta-data element and activities to android/app/src/main/AndroidManifest.xml, section application:
    <meta-data android:name="com.facebook.sdk.ApplicationId" 
    <activity android:name="com.facebook.FacebookActivity"
        android:label="@string/app_name" />
    <activity android:name="com.facebook.CustomTabActivity"
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="@string/fb_login_protocol_scheme" />
  • Add a uses-permission element to the manifest after the application element:
<uses-permission android:name="android.permission.INTERNET"/>
  • Complete Step 5. Associate Your Package Name and Default Class with Your App. (Skip all the step 6 if you already created the account in Facebook developers).
  • Set Package Name - your package name for Android application (attribute package in AndroidManifest.xml).
  • Set Default Activity Class Name - your main activity class (with package). By default it would be LoginActivity.java.
  • Click "Save".
  • Complete Step 6. Provide the Development and Release Key Hashes for Your App.

  • Skip the next steps.

Setup iOS #

  • Complete Step 1. Select an app or create a new app. If you already created an app during an Android setup process than use it.
  • Skip Step 2 "Set up Your Development Environment" and Step 3 "Integrate the Facebook SDK"
  • Add your Bundle Identifier - set Bundle Identifier (you can find it in Xcode: Runner - Target Runner - General, section Identity, field Bundle Identifier) and "Save". Maybe in the Flutter root you will need to assign manually in (ios/Runner.xcodeproj/project.pbxproj) search all the PRODUCT_BUNDLE_IDENTIFIER and put the new Bundle Identifier

Complete Step 4. Configure Your Project

  • Configure Info.plist (ios/Runner/Info.plist):
  • Also add to Info.plist body:

Complete Step 5. Connect Your App Delegate

  • In Xcode Connect Your App Delegate (Runner/Runner/AppDelegate), with the next code
import Flutter
import FBSDKCoreKit

@objc class AppDelegate: FlutterAppDelegate {
    override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
    GeneratedPluginRegistrant.register(with: self)
    //Facebook support
              didFinishLaunchingWithOptions: launchOptions
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
    override func application(
            _ application: UIApplication,
            open url: URL,
            sourceApplication: String?,
            annotation: Any
        ) -> Bool {

            return ApplicationDelegate.shared.application(
                application, open: url,
                sourceApplication: sourceApplication,
                annotation: annotation
    override func application(
    _ app: UIApplication,
    open url: URL,
    options: [UIApplication.OpenURLOptionsKey : Any] = [:]
) -> Bool {
    open: url,
    sourceApplication: options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String,
    annotation: options[UIApplication.OpenURLOptionsKey.annotation]
pub points


unverified uploader

Flutter Facebook to Log in and Sharing dialogs



API reference


BSD-3-Clause (license)


flutter, flutter_web_plugins


Packages that depend on flutter_facebook_plugin