TokenResolver

public protocol TokenResolver

Protocol that needs to be implemented by the developer for the purpose of supplying a Tokens object to the SDK.

  • This method will be called by the SDK to acquire the access/refresh tokens.

    Note

    Supplying either nil or a Tokens instance with invalid tokens will cause the pending request to fail with a BittiqApiError.unauthorized error.

    Note

    This method is always called on a background thread.

    Important

    The completion handler must always be called. If, for whatever reason, no tokens could be acquired, call the completion handler with a nil parameter.

    Declaration

    Swift

    func resolve(_ completion: @escaping (Tokens?) -> Void)

    Parameters

    completion

    Completion handler that needs to be called with a Tokens instance.