OnboardingContext
public struct OnboardingContext
This structure contains the parameters for an OnboardingStep in case the automatic flow management mode is used for Onboarding
-
The unique identifier of an onboarding flow. Can be used to support multi-user. Must be set before
restorecalled. The steps persisting information to the file system or keychain must use this ID to support separation of storage. At the end of theonboardingthis key must be persisted so later it can be used to callrestore.Declaration
Swift
public var onboardingID: UUID -
The main SAPURLSession instance of the application which will be configured correctly by
OnboardingSteps so the application can use it to communicate with the server; can be preconfigured by the Application developer.Declaration
Swift
public var sapURLSession: SAPURLSession -
PersistentStoreManagers supports creation of secure store with custom configuration. This property helps to access the created store with provided custom configuration.
Declaration
Swift
public var persistentStoreManger: PersistentStoreManaging -
The store used to persist small crednetial like informations (tokens, user credentials etc) used by all the
OnboardingSteps to save and restore information necessary for their tasks. The steps must store their created information here using a unique key.Declaration
Swift
public var credentialStore: CompositeCodableStoring -
Some step may require a different store to work with than the one provided in the context. You can create ID - STORE associations and use the
StoreSelectorStepto replace the store on the context for the wrapped step. The step can use thecredentialStoreproperty as usual, but the new store will be present.Declaration
Swift
public var credentialStores: [CredentialStoreID : CompositeCodableStoring] -
This class must present the ViewControllers created by the
OnboardingSteps. It is important that this delegate is saved by SAPURLSessionObservers and used to present screens when an authentication challenge happens and a screen needed for user input. The default implementation is theModalUIViewControllerPresenter. Please read the presenter’s documentation for further details on its usage.Declaration
Swift
public var presentationDelegate: FlowPresentationDelegate -
It must be a flat dictionary containing typed objects (structs, classes, URLs etc) used by the
OnboardingSteps under the keys declared by theOnboardingSteps. AllOnboardingStepdeclares the key under which they expect the data to be present to be able to perform the tasks. Configuration provider steps must pass the transformed configuration here. This structure will not and cannot be persisted directly as the data stored are not necessarily conform to any transformation protocols. This is intended to be used only for short term memory storage of argument objects. When an object is passed it overwrites the existing objects.Declaration
Swift
public var info: [OnboardingInfoKey : Any] -
Instantiates the OnboardingContext.
Declaration
Swift
public init(onboardingID: UUID = UUID(), sapURLSession: SAPURLSession = SAPURLSession(), persistentStoreManager: PersistentStoreManaging = SecureKeyValueStoreManager(), credentialStore: CompositeCodableStoring = CompositeStorage(), presentationDelegate: FlowPresentationDelegate = ModalUIViewControllerPresenter(), info: [OnboardingInfoKey : Any] = [:])Parameters
onboardingIDThe unique identifier of an onboarding flow.
sapURLSessionThe main SAPURLSession instance of the application.
credentialStoreThe store used to persist small crednetial like informations.
presentationDelegateThis class must present the ViewControllers created by the
OnboardingSteps.infoA flat dictionary containing typed objects.
-
Instantiates the OnboardingContext. The underlying
SAPURLSessionwill be created with aSAPHTTPCookieStoragewhich persists the cookies into thecredentialStore.Declaration
Swift
public init(onboardingID: UUID = UUID(), credentialStore: CompositeCodableStoring = CompositeStorage(), persistentStoreManager: PersistentStoreManaging = SecureKeyValueStoreManager(), presentationDelegate: FlowPresentationDelegate = ModalUIViewControllerPresenter(), info: [OnboardingInfoKey : Any] = [:])Parameters
onboardingIDThe unique identifier of an onboarding flow.
credentialStoreThe store used to persist small crednetial like informations.
presentationDelegateThis class must present the ViewControllers created by the
OnboardingSteps.infoA flat dictionary containing typed objects.