StoreManagerStep

open class StoreManagerStep : OnboardingStep

Manages the persistent store in the onboarding flow Creates and opens a SecureKeyValueStore instance in the folder specified by SecureStoreFolderPath parameter or in applicationSupportDirectory when not specified including the OnboardingID in the file name. The StoreManagerStep uses multiple screens from SAPFiori, for example TouchID and Passcode screens. The texts on these screens are also customizable. The localizable UI components are grouped in FUIPasscodeController. The following example code snippet describes how to change/localize elements of StoreManagerStep

Customization

func customStoreManagerStep() -> OnboardingStep {

   let storeManagerStepBundle = Bundle(for: StoreManagerStep.self)
   let localizedChoosePasscodeTitleString = NSLocalizedString("StoreManagerChoosePasscodeTitleKey", tableName: "ExampleTableName", bundle: storeManagerStepBundle, value: "Example choose passcode text", comment: "")
   let localizedConfirmPasscodeString = NSLocalizedString("StoreManagerConfirmPasscodeKey", tableName: "ExampleTableName", bundle: storeManagerStepBundle, value: "Example confirm passcode text", comment: "")
   let localizedLearnMoreTouchIDLinkString = NSLocalizedString("StoreManagerLearnMoreTouchIDLinkKey", tableName: "ExampleTableName", bundle: storeManagerStepBundle, value: "Example learn more about touch id text", comment: "")
   let localizedSetPasscodeMessageFormat = NSLocalizedString("StoreManagerSetPasscodeMessageFormatKey", tableName: "ExampleTableName", bundle: storeManagerStepBundle, value: "Example set passcode message", comment: "")
   // ... localizations for other components

   FUIPasscodeController.choosePasscodeTitleString = localizedChoosePasscodeTitleString
   FUIPasscodeController.confirmPasscodeString = localizedConfirmPasscodeString
   FUIPasscodeController.learnMoreTouchIDLinkString = localizedLearnMoreTouchIDLinkString
   FUIPasscodeController.setPasscodeMessageFormat = localizedSetPasscodeMessageFormat
   // ... setting localization of other components ...
   return StoreManagerStep()

} ```
  • The key used to store the passcode hash.

    Declaration

    Swift

    public static let onboardingPasscodeHash: String
  • This prefix will be used to create the store with the onboardingID in the following format: Name-ID

    Declaration

    Swift

    public var secureStoreNamePrefix: String
  • The OnboardingInfoKey associated with an instance of FUIPasscodePolicy in the OnboardingContext info.

    Declaration

    Swift

    public let passcodePolicyInfoKey: OnboardingInfoKey
  • PersistentStoreManaging implementation to manage the persistent store If ContextSupporting is implemented its methods will be called

    Declaration

    Swift

    public var persistentStoreManager: PersistentStoreManaging! { get }
  • FUIPasscodeValidationDelegate used by the FUI passcode screens. StoreManagerStep sets the same property on StoreManager when it is created. For more info @see FUIPasscodeValidationDelegate

    Declaration

    Swift

    public weak var passcodeValidationDelegate: FUIPasscodeValidationDelegate?
  • FUIPasscodeControllerDelegate used by the FUI passcode screens. StoreManagerStep sets the same property on StoreManager when it is created. For more info @see FUIPasscodeControllerDelegate

    Declaration

    Swift

    public weak var userPasscodeControllerDelegate: FUIPasscodeControllerDelegate?
  • default passcode policy for step

    Declaration

    Swift

    public var defaultPasscodePolicy: SAPFiori.FUIPasscodePolicy?
  • Enable adding additional user-defined passcode policy rules.

    Declaration

    Swift

    public var passcodePolicyRules: [FUIPasscodeRule]
  • If this is true, there will be a “Cancel” button on the passcode input view. The result of this step will be failed with StoreManagerError.cancelPasscodeEntry error when user tapped this “Reset” button. The default value is false.

    Declaration

    Swift

    @available(*, deprecated, message: "will be removed in future release")
    public var showsCancelButtonOnRestore: Bool
  • If this is true, there will be a “Reset Passcode” button on the passcode input view when user entered a wrong passcode. The result of this step will be failed with StoreManagerError.resetPasscode error when user tapped this “Reset” button. The default value is true.

    Declaration

    Swift

    @available(*, deprecated, message: "will be removed in future release")
    public var showsResetButtonOnRestore: Bool
  • This image will be displayed under the Touch ID authentication popup on the restore step.

    Declaration

    Swift

    @available(*, deprecated, message: "will be removed in future release")
    public var backgroundImageForTouchIDView: UIImage?
  • The ID of the created store. If this value is nil, then the onboardingID is used.

    Declaration

    Swift

    public var storeID: UUID?
  • The keychain access group used to store settings. This property has a default value if the KeychainStoreManager is used as the persistent store manager.

    Declaration

    Swift

    public var accessGroup: String?
  • Widget parameters

    Declaration

    Swift

    public var auxiliaryParameters: AuxiliaryParameters?
  • Runs the restore method during onboarding if the store exists. By default this value is false.

    Declaration

    Swift

    public var runRestoreIfStoreExists: Bool
  • if the obfuscatedUserInfo flag is set to true the email on the multiuser passcode screen will be obfucated. Default value is false.

    Declaration

    Swift

    public var obfuscatedUserInfo: Bool
  • StoreManagerStep initializer with OnboardingInfoKeys

    Declaration

    Swift

    public init(passcodePolicyInfoKey: OnboardingInfoKey = .passcodePolicy, persistentStoreManager: PersistentStoreManaging = SecureKeyValueStoreManager())

    Parameters

    passcodePolicyInfoKey

    OnboardingInfoKey for passcodePolicyInfoKey parameter

    persistentStoreManager

    PersistentStoreManaging implementation e.g. SecureKeyValueStoreManager or KeychainStoreManager

  • StoreManagerStep onboard function

    Declaration

    Swift

    open func onboard(presentationDelegate: FlowPresentationDelegate, onboardingID: UUID, credentialStore: CompositeCodableStoring, passcodePolicy: FUIPasscodePolicy? = nil, completionHandler: @escaping (_ error: Error?) -> Void)

    Parameters

    delegate

    delegate which presents the step’s UIViewController

    onboardingID

    the identifier of the Onboarding used in the store name

    credentialStore

    the store where everything is stored regarding the onboarding

    passcodePolicy

    The FUIPasscodePolicy for this app if exists

    completionHandler

    called when the process is finished.

    error

    The Error during the process. Nil, if there wasn’t any.

  • Restore the previous state of onboarding

    Declaration

    Swift

    open func restore(presentationDelegate: FlowPresentationDelegate, onboardingID: UUID, credentialStore: CompositeCodableStoring, completionHandler: @escaping (_ error: Error?) -> Void)

    Parameters

    delegate

    delegate which presents the step’s UIViewController

    onboardingID

    the identifier of Onboarding

    credentialStore

    the store where everything is stored regarding the onboarding

    completionHandler

    called when the process is finished.

    error

    The Error during the process. Nil, if there wasn’t any.

  • Restore in background with the previous state of onboarding

    Declaration

    Swift

    open func background(onboardingID: UUID, credentialStore: CompositeCodableStoring, completionHandler: @escaping (_ error: Error?) -> Void)

    Parameters

    onboardingID

    the identifier of Onboarding

    credentialStore

    the store where everything is stored regarding the onboarding

    completionHandler

    called when the process is finished.

    error

    The Error during the process. Nil, if there wasn’t any.

  • Reset the modifications of OnboardingStep

    Declaration

    Swift

    open func reset(onboardingID: UUID, credentialStore: CompositeCodableStoring, completionHandler: @escaping () -> Void)

    Parameters

    onboardingID

    the identifier of Onboarding

    store

    the store where everything is stored regarding the onboarding

    completionHandler

    called when the process is finished

  • The FUIPasscodePolicy for this app. When run in “no-passcode” mode, this method is not called.

    Declaration

    Swift

    open func passcodePolicy() -> SAPFiori.FUIPasscodePolicy

    Return Value

    The FUIPasscodePolicy for this app.