Skip to main content
Version: 4.3.4

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>
    <string>fbauth2</string>
    <string>fbshareextension</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>

    To use any of the Facebook dialogs (e.g., Login, Share, App Invites, etc.) that can perform an app switch to Facebook apps, your application's Info.plist also needs to include: <dict>...</dict>)

    <key>LSApplicationQueriesSchemes</key>
    <array>
    <string>fbapi</string>
    <string>fbapi20130214</string>
    <string>fbapi20130410</string>
    <string>fbapi20130702</string>
    <string>fbapi20131010</string>
    <string>fbapi20131219</string>
    <string>fbapi20140410</string>
    <string>fbapi20140116</string>
    <string>fbapi20150313</string>
    <string>fbapi20150629</string>
    <string>fbapi20160328</string>
    <string>fbauth</string>
    <string>fb-messenger-share-api</string>
    <string>fbauth2</string>
    <string>fbshareextension</string>
    </array>
info

check one example of the info.plist here