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
headersA dictionary of key-value pairs representing custom headers.
urlTypeThe type of URL to be intercepted. Defaults to
.All.urlMatcherAn 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
contextThe
OnboardingContextused to perform onboarding.completionHandlerA 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
contextThe
OnboardingContextused to restore.completionHandlerA 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
contextThe context used in the reset process.
completionHandlerA closure called upon completion of the reset.
-
Creates a
CustomHeadersObserverwith the specified headers and URL matcher.Declaration
Swift
open func createCustomHeadersObserver(_ headers: [String : String], _ urlMatcher: URLMatching) -> CustomHeadersObserverParameters
headersA dictionary of key-value pairs representing custom headers.
urlMatcherAn object that matches URLs.
Return Value
A new instance of
CustomHeadersObserver.