Why use Facebook Login
- No passwords to manage. Users authenticate through Facebook’s secure identity layer, so you never store or transmit passwords.
- Rich profile data. With the user’s consent, you can access their name, profile picture, email, and more through the Graph API.
- Trusted brand. The “Continue with Facebook” button is a recognized pattern that reduces friction at sign-in.
- Token lifecycle management. The SDK automatically stores, refreshes, and exposes access tokens through
AccessToken.current.
Two login modes
The SDK supports two distinct login tracking modes, controlled by theLoginTracking setting on your LoginConfiguration.
| Mode | Tracking | Token type | iOS requirement |
|---|---|---|---|
| Standard Login | .enabled | AccessToken | iOS 13+ |
| Limited Login | .limited | AuthenticationToken | iOS 14+ |
LoginTracking.enabled) is the traditional Facebook Login flow. It issues an AccessToken that you can use to make Graph API calls on the user’s behalf.
Limited Login (LoginTracking.limited) is a privacy-preserving mode introduced for iOS 14+. It does not produce an AccessToken and cannot be used for Graph API calls. Instead, it returns an AuthenticationToken (an OIDC ID token) that you use only to authenticate the user’s identity.
How Facebook Login works
Facebook Login is built on OAuth 2.0. Here is a summary of the standard flow:Check for a cached token
Before presenting a login UI, check
AccessToken.current. If a valid token exists, the user is already logged in and you can skip the login flow.Build a LoginConfiguration
Create a
LoginConfiguration that specifies the permissions you need and the tracking mode.Invoke LoginManager
Call
logIn(viewController:configuration:completion:). The SDK opens the Facebook app or a web dialog for the user to authorize.Handle the result
The completion block receives a
LoginResult enum value: .success, .cancelled, or .failed.Permissions overview
Permissions control which data your app can access. You request them inLoginConfiguration and inspect the granted set in the login result. Always request the minimum set of permissions your feature requires.
See Permissions for a full reference.
Pages in this section
LoginManager
Programmatic login and logout using
LoginManager.Login button
Drop-in
FBLoginButton UI component with delegate callbacks.Permissions
Request and inspect Facebook permissions.
Access tokens
Work with
AccessToken and its properties.Limited Login
iOS 14+ privacy-preserving login with
LoginTracking.limited.