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()
} ```
-
Customization of FUIPasscodeController
Declaration
Swift
public var passcodeControllerCustomizationHandler: ((FUIPasscodeController) -> Void)?
-
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
OnboardingInfoKeyassociated with an instance ofFUIPasscodePolicyin theOnboardingContextinfo.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.cancelPasscodeEntryerror when user tapped this “Reset” button. The default value isfalse.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.resetPasscodeerror when user tapped this “Reset” button. The default value istrue.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
KeychainStoreManageris 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
passcodePolicyInfoKeyOnboardingInfoKey for passcodePolicyInfoKey parameter
persistentStoreManagerPersistentStoreManaging 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
delegatedelegate which presents the step’s UIViewController
onboardingIDthe identifier of the Onboarding used in the store name
credentialStorethe store where everything is stored regarding the onboarding
passcodePolicyThe FUIPasscodePolicy for this app if exists
completionHandlercalled when the process is finished.
errorThe
Errorduring 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
delegatedelegate which presents the step’s UIViewController
onboardingIDthe identifier of Onboarding
credentialStorethe store where everything is stored regarding the onboarding
completionHandlercalled when the process is finished.
errorThe
Errorduring 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
onboardingIDthe identifier of Onboarding
credentialStorethe store where everything is stored regarding the onboarding
completionHandlercalled when the process is finished.
errorThe
Errorduring 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
onboardingIDthe identifier of Onboarding
storethe store where everything is stored regarding the onboarding
completionHandlercalled when the process is finished
-
Onboarding function with
OnboardingContextsupportDeclaration
Swift
open func onboard(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)Parameters
contextOnboardingContextobject which contains every information for the OnboardingStepcompletionHandlercalled when the process finished. Step OnboardingResult filled.
-
Restore function with
OnboardingContextsupportDeclaration
Swift
open func restore(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)Parameters
contextOnboardingContextobject which contains every information for the OnboardingStepcompletionHandlercalled when the process finished. Step OnboardingResult filled.
-
Background function with
OnboardingContextsupportDeclaration
Swift
open func background(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)Parameters
contextOnboardingContextobject which contains every information for the OnboardingStepcompletionHandlercalled when the process finished. Step OnboardingResult filled.
-
resetPasscode function with
OnboardingContextsupportDeclaration
Swift
open func resetPasscode(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)Parameters
contextcompletionHandlercalled when the process finished. Step OnboardingResult filled.
-
Reset function with
OnboardingContextsupportDeclaration
Swift
open func reset(context: OnboardingContext, completionHandler: @escaping () -> Void)Parameters
contextOnboardingContextobject which contains every information for the OnboardingStepcompletionHandlercalled when the process finished.
-
The
FUIPasscodePolicyfor this app. When run in “no-passcode” mode, this method is not called.Declaration
Swift
open func passcodePolicy() -> SAPFiori.FUIPasscodePolicyReturn Value
The FUIPasscodePolicy for this app.