Skip to main content
Version: 6.2.0

iOS configuration

IMPORTANT

For Objective-C projects this plugin won't work because this plugin was written in swift. So you need to use swift as a default language for your flutter project (Check how to change to swift here).

  • In your Podfile uncomment the next line (You need set the minimum target to 12.0 or higher)
platform :ios, '12.0'

And in xcode you must set your deployment Info to 12.0

  • Go to Facebook Login for iOS - Quickstart and select or create your app.

  • Skip the step 2 (Set up Your Development Environment).

  • In the step 3 (Register and Configure Your App with Facebook) you need add your Bundle Identifier

    You can find your Bundle Identifier in Xcode (Runner - Target Runner - General)

    image

  • In the Step 4 you need configure your Info.plist file inside ios/Runner/Info.plist

    From Xcode you can open your Info.plist as Source Code now add the next code and replace {your-app-id} with your facebook app Id.

    In the key FacebookClientToken, replace CLIENT-TOKEN with the value found under Settings > Advanced > Client Token in your App Dashboard.

    <key>CFBundleURLTypes</key>
    <array>
    <dict>
    <key>CFBundleURLSchemes</key>
    <array>
    <string>fb{your-app-id}</string>
    </array>
    </dict>
    </array>
    <key>FacebookAppID</key>
    <string>{your-app-id}</string>
    <key>FacebookClientToken</key>
    <string>CLIENT-TOKEN</string>
    <key>FacebookDisplayName</key>
    <string>{your-app-name}</string>
    <key>LSApplicationQueriesSchemes</key>
    <array>
    <string>fbapi</string>
    <string>fb-messenger-share-api</string>
    </array>

    If you have implement another providers (Like Google) in your app you should merge values in Info.plist

    Check if you already have CFBundleURLTypes or LSApplicationQueriesSchemes keys in your Info.plist. If you have, you should merge their values, instead of adding a duplicate key.

    Example with Google and Facebook implemetation:

    <key>CFBundleURLTypes</key>
    <array>
    <dict>
    <key>CFBundleTypeRole</key>
    <string>Editor</string>
    <key>CFBundleURLSchemes</key>
    <array>
    <string>fb{your-app-id}</string>
    <string>com.googleusercontent.apps.{your-app-specific-url}</string>
    </array>
    </dict>
    </array>
info

check one example of the info.plist here

KEEP IN MIND
  • If the login callback doesn't works check that you are not overriding the next function in your AppDelegate.swift
override func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
...
}

For more info check

https://github.com/darwin-morocho/flutter-facebook-auth/issues/261

https://github.com/darwin-morocho/flutter-facebook-auth/issues/6