Overview
LoginConfiguration describes everything about a single login attempt: which permissions to request, how the SDK should handle tracking, which Messenger page to associate with the request, and the PKCE code verifier to use. You pass a LoginConfiguration to LoginManager.logIn(viewController:configuration:completion:).
All initializers are failable. They return nil if any parameter is invalid—for example, if the nonce contains whitespace or the permissions array contains invalid values.
Module: FacebookLoginDeclared in:
LoginConfiguration.swiftObjective-C name:
FBSDKLoginConfiguration
Initializers
init(permissions:tracking:)
The most common initializer. A random UUID is used as the nonce.
Permission strings to request, e.g.
["public_profile", "email"]. Each string must not contain whitespace. Pass an empty array to request no additional permissions.Whether to use
.enabled (standard) or .limited tracking. See LoginTracking.init(permissions:tracking:messengerPageId:authType:)
Creates a configuration associated with a Messenger page and a specific auth type.
Permissions to request.
Tracking preference for this login attempt.
The Facebook page ID to associate with this login when using Messenger.
The auth type for this request. Valid values are
.rerequest and .reauthorize. Pass nil to omit the parameter. See LoginAuthType.init(permissions:tracking:messengerPageId:authType:codeVerifier:) (designated)
The full designated initializer with explicit control over all parameters including the PKCE code verifier.
Permissions to request.
Tracking preference.
A non-empty alphanumeric string without whitespace used to associate the login attempt with a token. A UUID is generated automatically by the convenience initializers.
Optional Messenger page ID.
Optional auth type. Accepts
.rerequest or .reauthorize only.Controls whether the SDK may switch to the Facebook app to complete login.
The PKCE code verifier. If you do not need a specific verifier, use
CodeVerifier() to generate one.Properties
The set of permissions that were requested when this configuration was created.
The tracking preference for this login attempt. Defaults to
.enabled.The nonce used for this login attempt. A unique UUID is generated when you use the convenience initializers.
The Messenger page ID associated with this login request, or
nil if not set.The auth type associated with this login request.
The app switch behavior to use for this login attempt. Defaults to
.enabled.The PKCE code verifier. Generated automatically if not provided.
LoginTracking enum
| Case | Description |
|---|---|
.enabled | Standard login with full tracking. The SDK collects analytics and uses access tokens as normal. |
.limited | Limited login mode introduced for iOS 14+. Reduces data collection; uses AuthenticationToken instead of AccessToken. |
LoginAuthType
LoginAuthType is a typed string (NS_TYPED_EXTENSIBLE_ENUM in Objective-C).
| Value | Description |
|---|---|
.rerequest | Re-requests permissions that were previously declined by the user. This is the default. |
.reauthorize | Re-authorizes data access after it has expired. Used internally by reauthorizeDataAccess(from:handler:). |