Facebook Login

If you would like to include Facebook login in your app, then you will need to set up a few things.
  1. Add your Facebook App ID to the Commerce Panel under General Settings.
  2. Add your Facebook App ID to your Info.plist using the key FacebookAppID.
  3. Add the Facebook URL scheme to your Info.plist:
    • In Xcode, select your Target.
    • Under URL Types, add a new type (+ button).
    • In the URL Scheme field, enter the scheme provided by Facebook (e.g. fb1234567890).
  4. Updates to Info.plist.
    • Add or update the LSApplicationQueriesSchemes array. It should include fbauth2. For example:
  1. xml
<key>LSApplicationQueriesSchemes</key>
<array>
    <string>fbapi</string>
    <string>fb-messenger-api</string>
    <string>fbauth2</string>
    <string>fbshareextension</string>
</array>
  • NSAppTransportSecurity allows us to securely communicate with Facebook in iOS 9+.
  1. xml
<key>NSAppTransportSecurity</key>
<dict>
    <key>NSExceptionDomains</key>
    <dict>
        <key>cloudfront.net</key>
        <dict>
            <key>NSExceptionRequiresForwardSecrecy</key>
            <false/>
            <key>NSIncludesSubdomains</key>
            <true/>
        </dict>
        <key>facebook.com</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSExceptionRequiresForwardSecrecy</key>
            <false/>
        </dict>
        <key>fbcdn.net</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSExceptionRequiresForwardSecrecy</key>
            <false/>
        </dict>
        <key>akamaihd.net</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSExceptionRequiresForwardSecrecy</key>
            <false/>
        </dict>
    </dict>
</dict>