CustomHeadersStep

open class CustomHeadersStep : OnboardingStep

Provides an onboarding step implementation to support custom headers in Foundation. This step is used in the onboarding/restoring flow to configure the app’s URLSession, enabling it to send appropriate custom headers with configured URLs. It creates and registers the CustomHeadersObserver to the SAPURLSession.

  • Initializes the CustomHeadersStep.

    Declaration

    Swift

    public init(headers: [String : String], urlType: URLType? = .All, urlMatcher: URLMatching? = nil)

    Parameters

    headers

    A dictionary of key-value pairs representing custom headers.

    urlType

    The type of URL to be intercepted. Defaults to .All.

    urlMatcher

    An object that matches URLs. Defaults to nil.

  • Executes onboarding with the provided context.

    Declaration

    Swift

    open func onboard(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)

    Parameters

    context

    The OnboardingContext used to perform onboarding.

    completionHandler

    A closure that handles the result of onboarding.

  • Executes restoration with the provided context.

    Declaration

    Swift

    open func restore(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)

    Parameters

    context

    The OnboardingContext used to restore.

    completionHandler

    A closure that handles the result of restoration.

  • Resets the onboarding step with the provided context.

    Declaration

    Swift

    open func reset(context: OnboardingContext, completionHandler: @escaping () -> Void)

    Parameters

    context

    The context used in the reset process.

    completionHandler

    A closure called upon completion of the reset.

  • Creates a CustomHeadersObserver with the specified headers and URL matcher.

    Declaration

    Swift

    open func createCustomHeadersObserver(_ headers: [String : String], _ urlMatcher: URLMatching) -> CustomHeadersObserver

    Parameters

    headers

    A dictionary of key-value pairs representing custom headers.

    urlMatcher

    An object that matches URLs.

    Return Value

    A new instance of CustomHeadersObserver.