ParseFacebook

public struct ParseFacebook<AuthenticatedUser> : ParseAuthentication where AuthenticatedUser : ParseUser

Provides utility functions for working with Facebook User Authentication and ParseUser‘s. Be sure your Parse Server is configured for sign in with Facebook. For information on acquiring Facebook sign-in credentials to use with ParseFacebook, refer to Facebook’s Documentation.

  • Declaration

    Swift

    public static var __type: String { get }

Login

  • Login a ParseUser asynchronously using Facebook authentication for limited login.

    Declaration

    Swift

    func login(userId: String,
               authenticationToken: String,
               expiresIn: Int? = nil,
               options: API.Options = [],
               callbackQueue: DispatchQueue = .main,
               completion: @escaping (Result<AuthenticatedUser, ParseError>) -> Void)

    Parameters

    userId

    The Facebook userId from FacebookSDK.

    authenticationToken

    The authenticationToken from FacebookSDK.

    expiresIn

    Optional expiration in seconds for Facebook login.

    options

    A set of header options sent to the server. Defaults to an empty set.

    callbackQueue

    The queue to return to after completion. Default value of .main.

    completion

    The block to execute.

  • Login a ParseUser asynchronously using Facebook authentication for graph API login.

    Declaration

    Swift

    func login(userId: String,
               accessToken: String,
               expiresIn: Int? = nil,
               options: API.Options = [],
               callbackQueue: DispatchQueue = .main,
               completion: @escaping (Result<AuthenticatedUser, ParseError>) -> Void)

    Parameters

    userId

    The Facebook userId from FacebookSDK.

    accessToken

    The accessToken from FacebookSDK.

    expiresIn

    Optional expiration in seconds for Facebook login.

    options

    A set of header options sent to the server. Defaults to an empty set.

    callbackQueue

    The queue to return to after completion. Default value of .main.

    completion

    The block to execute.

  • Declaration

    Swift

    func login(authData: [String: String],
               options: API.Options = [],
               callbackQueue: DispatchQueue = .main,
               completion: @escaping (Result<AuthenticatedUser, ParseError>) -> Void)
  • Login a ParseUser asynchronously using Facebook authentication for limited login. Publishes when complete.

    Declaration

    Swift

    @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
    func loginPublisher(userId: String,
                        authenticationToken: String,
                        expiresIn: Int? = nil,
                        options: API.Options = []) -> Future<AuthenticatedUser, ParseError>

    Parameters

    userId

    The userId from FacebookSDK.

    authenticationToken

    The authenticationToken from FacebookSDK.

    expiresIn

    Optional expiration in seconds for Facebook login.

    options

    A set of header options sent to the server. Defaults to an empty set.

    Return Value

    A publisher that eventually produces a single value and then finishes or fails.

  • Login a ParseUser asynchronously using Facebook authentication for graph API login. Publishes when complete.

    Declaration

    Swift

    @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
    func loginPublisher(userId: String,
                        accessToken: String,
                        expiresIn: Int? = nil,
                        options: API.Options = []) -> Future<AuthenticatedUser, ParseError>

    Parameters

    userId

    The userId from FacebookSDK.

    accessToken

    The accessToken from FacebookSDK.

    expiresIn

    Optional expiration in seconds for Facebook login.

    options

    A set of header options sent to the server. Defaults to an empty set.

    Return Value

    A publisher that eventually produces a single value and then finishes or fails.

  • Declaration

    Swift

    @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
    func loginPublisher(authData: [String: String],
                        options: API.Options = []) -> Future<AuthenticatedUser, ParseError>

Link

  • Link the current ParseUser asynchronously using Facebook authentication for limited login.

    Declaration

    Swift

    func link(userId: String,
              authenticationToken: String,
              expiresIn: Int? = nil,
              options: API.Options = [],
              callbackQueue: DispatchQueue = .main,
              completion: @escaping (Result<AuthenticatedUser, ParseError>) -> Void)

    Parameters

    userId

    The userId from FacebookSDK.

    authenticationToken

    The authenticationToken from FacebookSDK.

    expiresIn

    Optional expiration in seconds for Facebook login.

    options

    A set of header options sent to the server. Defaults to an empty set.

    callbackQueue

    The queue to return to after completion. Default value of .main.

    completion

    The block to execute.

  • Link the current ParseUser asynchronously using Facebook authentication for graph API login.

    Declaration

    Swift

    func link(userId: String,
              accessToken: String,
              expiresIn: Int? = nil,
              options: API.Options = [],
              callbackQueue: DispatchQueue = .main,
              completion: @escaping (Result<AuthenticatedUser, ParseError>) -> Void)

    Parameters

    userId

    The userId from FacebookSDK.

    accessToken

    The accessToken from FacebookSDK.

    expiresIn

    Optional expiration in seconds for Facebook login.

    options

    A set of header options sent to the server. Defaults to an empty set.

    callbackQueue

    The queue to return to after completion. Default value of .main.

    completion

    The block to execute.

  • Declaration

    Swift

    func link(authData: [String: String],
              options: API.Options = [],
              callbackQueue: DispatchQueue = .main,
              completion: @escaping (Result<AuthenticatedUser, ParseError>) -> Void)
  • Link the current ParseUser asynchronously using Facebook authentication for limited login. Publishes when complete.

    Declaration

    Swift

    @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
    func linkPublisher(userId: String,
                       authenticationToken: String,
                       expiresIn: Int? = nil,
                       options: API.Options = []) -> Future<AuthenticatedUser, ParseError>

    Parameters

    userId

    The userId from FacebookSDK.

    authenticationToken

    The authenticationToken from FacebookSDK.

    expiresIn

    Optional expiration in seconds for Facebook login.

    options

    A set of header options sent to the server. Defaults to an empty set.

    Return Value

    A publisher that eventually produces a single value and then finishes or fails.

  • Link the current ParseUser asynchronously using Facebook authentication for graph API login. Publishes when complete.

    Declaration

    Swift

    @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
    func linkPublisher(userId: String,
                       accessToken: String,
                       expiresIn: Int? = nil,
                       options: API.Options = []) -> Future<AuthenticatedUser, ParseError>

    Parameters

    userId

    The userId from FacebookSDK.

    accessToken

    The accessToken from FacebookSDK.

    expiresIn

    Optional expiration in seconds for Facebook login.

    options

    A set of header options sent to the server. Defaults to an empty set.

    Return Value

    A publisher that eventually produces a single value and then finishes or fails.

  • Declaration

    Swift

    @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
    func linkPublisher(authData: [String: String],
                       options: API.Options = []) -> Future<AuthenticatedUser, ParseError>