BrowserBuilder

@objc(FRBrowserBuilder)
public class BrowserBuilder : NSObject

BrowserBuilder is a builder class for progressive construction of Browser object.

  • Sets BrowserType (an external user-agent) for Browser object; default to .authSession

    Declaration

    Swift

    @discardableResult
    @objc(setBrowserType:)
    public func set(browserType: BrowserType) -> BrowserBuilder

    Parameters

    browserType

    An external user-agent type to be used for /authorize flow

    Return Value

    BrowserBuilder object to progressively build Browser object

  • Sets presenting ViewController which will be used as ASPresentationAnchor for ASWebAuthenticationSession in iOS 13.0 or above

    Declaration

    Swift

    @discardableResult
    @objc(setPresentingViewController:)
    public func set(presentingViewController: UIViewController) -> BrowserBuilder

    Parameters

    presentingViewController

    ViewController that will act as ASPresentationAnchor for ASWebAuthenticationSession

    Return Value

    BrowserBuilder object to progressively build Browser object

  • Sets custom URL Query parameters to be added to /authorize request

    Declaration

    Swift

    @discardableResult
    @objc(setCustomKey:CustomValue:)
    public func setCustomParam(key: String, value: String) -> BrowserBuilder

    Parameters

    key

    URL Query parameter key

    value

    URL Query parameter value

    Return Value

    BrowserBuilder object to progressively build Browser object

  • Completes progressive building of Browser object, and constructs Browser object based on given values

    Declaration

    Swift

    @objc
    public func build() -> Browser

    Return Value

    Browser object to start authentication