Overview
The Facebook Login SDK exposes two representations of a login outcome:LoginResult— a@frozenSwift enum used by theLoginResultBlockclosure. This is the type you receive in the SwiftlogIn(viewController:configuration:completion:)callback.LoginManagerLoginResult— anNSObjectsubclass used for Objective-C compatibility and for theLoginManagerLoginResultBlockcallback.
FacebookLoginDeclared in:
LoginResult.swift, LoginManagerLoginResult.swift
LoginResult enum
Cases
The login completed successfully. Contains the set of granted permissions, the set of declined permissions, and an optional
AccessToken. The token is nil when using .limited tracking.The user dismissed the login dialog without completing the flow.
The login attempt encountered an error. The associated value is the underlying
Error.Pattern matching
LoginResultBlock type alias
LoginManagerLoginResult class
LoginManagerLoginResult is the Objective-C–compatible result type. You receive it in the LoginManagerLoginResultBlock callback used by logIn(permissions:from:handler:) and reauthorizeDataAccess(from:handler:).
Objective-C name: FBSDKLoginManagerLoginResult
Initializer
Properties
The
AccessToken granted by the login attempt. This is nil if the login was cancelled, failed, or used .limited tracking.The
AuthenticationToken provided when using .limited tracking (OpenID Connect).true if the user dismissed the login dialog without completing the flow.The permissions that were granted during this specific login request. Check
AccessToken.current?.permissions for the full set of currently-granted permissions.The permissions that were explicitly declined during this login request.
Objective-C usage example
Choosing between the two types
| Scenario | Recommended type |
|---|---|
Swift code using logIn(viewController:configuration:completion:) | LoginResult |
Objective-C code or legacy Swift using logIn(permissions:from:handler:) | LoginManagerLoginResult |
| Reauthorizing data access | LoginManagerLoginResult via LoginManagerLoginResultBlock |