Facebook Login
If you would like to include Facebook login in your app, then you will need to set up a few things.- Add your Facebook App ID to the Commerce Panel under General Settings.
-
Add your Facebook App ID to your Info.plist using the key
FacebookAppID. -
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).
-
Updates to Info.plist.
-
Add or update the
LSApplicationQueriesSchemesarray. It should includefbauth2. For example:
-
Add or update the
- xml
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fb-messenger-api</string>
<string>fbauth2</string>
<string>fbshareextension</string>
</array>NSAppTransportSecurityallows us to securely communicate with Facebook in iOS 9+.
- 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>