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 restore called. The steps persisting information to the file system or keychain must use this ID to support separation of storage. At the end of the onboarding this key must be persisted so later it can be used to call restore.

    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 StoreSelectorStep to replace the store on the context for the wrapped step. The step can use the credentialStore property 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 the ModalUIViewControllerPresenter. 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 the OnboardingSteps. All OnboardingStep declares 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

    onboardingID

    The unique identifier of an onboarding flow.

    sapURLSession

    The main SAPURLSession instance of the application.

    credentialStore

    The store used to persist small crednetial like informations.

    presentationDelegate

    This class must present the ViewControllers created by the OnboardingSteps.

    info

    A flat dictionary containing typed objects.

  • Instantiates the OnboardingContext. The underlying SAPURLSession will be created with a SAPHTTPCookieStorage which persists the cookies into the credentialStore.

    Declaration

    Swift

    public init(onboardingID: UUID = UUID(), credentialStore: CompositeCodableStoring = CompositeStorage(), persistentStoreManager: PersistentStoreManaging = SecureKeyValueStoreManager(), presentationDelegate: FlowPresentationDelegate = ModalUIViewControllerPresenter(), info: [OnboardingInfoKey : Any] = [:])

    Parameters

    onboardingID

    The unique identifier of an onboarding flow.

    credentialStore

    The store used to persist small crednetial like informations.

    presentationDelegate

    This class must present the ViewControllers created by the OnboardingSteps.

    info

    A flat dictionary containing typed objects.