requestUserCredentials(presentationContextProvider_callbackURL_with_) - daneden/Twift GitHub Wiki

requestUserCredentials(presentationContextProvider:callbackURL:with:)

Request user credentials by presenting Twitter's web-based authentication flow

public func requestUserCredentials(
    presentationContextProvider: ASWebAuthenticationPresentationContextProviding? = nil,
    callbackURL: URL,
    with completion: @escaping ((userCredentials: OAuthCredentials?, error: Error?)) -> Void
  )

Parameters

  • presentationContextProvider: Optional presentation context provider. When not provided, this function will handle the presentation context itself.
  • callbackURL: The callback URL as configured in your Twitter application settings
  • completion: A callback that allows the caller to handle subsequent user credentials or errors. Callers are responsible for storing the user credentials for later use.