SAPcpmsDestinationsDownloadStep
open class SAPcpmsDestinationsDownloadStep : OnboardingStep
Class for SAPcpmsDestinations download onboarding step handling
Customization
During the onboarding flow, if there is a splash screen which shows a text, that text can be changed/localized.
// The localized SAPcpmsDestinationsDownloadStep can be created like the following code snippet
func customDestinationsDownloadStep() -> OnboardingStep {
let step = SAPcpmsDestinationsDownloadStep()
let sapcpmsDestinationsDownloadStep = Bundle(for: SAPcpmsDestinationsDownloadStep.self)
step.infoScreenText = NSLocalizedString("SAPcpmsDestinationsDownloadInfoScreenTextKey", tableName: "ExampleTableName", bundle: sapcpmsDestinationDownloadBundle, value: "Example Info Screen Text", comment: "")
return step
}
-
The
OnboardingInfoKey
associated with an instance ofSAPcpmsSettingsParameters
in theOnboardingContext
info.Declaration
Swift
public var settingsInfoKey: OnboardingInfoKey
-
Property to set the title of info screen
Declaration
Swift
public var infoScreenText: String
-
Default initializer
Declaration
Swift
public init()
-
Onboarding function with
OnboardingContext
support; Downloads the Destinations from mobile services and updates the stored ‘SAPcpmsSettingsParameters’ with them in the ‘context’.Declaration
Swift
open func onboard(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)
Parameters
context
OnboardingContext
object which contains every information for the OnboardingStepcompletionHandler
called when the process finished. Error filled on failure.
-
Restore function with
OnboardingContext
supportDeclaration
Swift
open func restore(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)
Parameters
context
OnboardingContext
object which contains every information for the OnboardingStepcompletionHandler
called when the process finished. Error filled on failure.
-
resetPasscode function with
OnboardingContext
supportDeclaration
Swift
open func resetPasscode(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)
Parameters
context
completionHandler
called when the process finished. Step OnboardingResult filled.
-
This function resets the modifications of SAPcpmsDownloadStep modifications in
OnboardingContext
Declaration
Swift
open func reset(context: OnboardingContext, completionHandler: @escaping () -> Void)
Parameters
context
OnboardingContext
object which contains every information for the OnboardingStepcompletionHandler
called when the process finished.
-
Onboarding function without context for SAPcpmsDestinations download.
Declaration
Swift
open func onboard(sapURLSession: SAPURLSession, settingsParameters: SAPcpmsSettingsParameters, completionHandler: @escaping ([OnboardingInfoKey : Any]?, Error?) -> Void)
Parameters
sapURLSession
SAPURLSession
that handles the connection to download destinationsettingsParameters
SAPcpms settings metadata to be able to concatenate the SAPcpms URL
completionHandler
called when the process finished. Error filled on failure.
-
Restore function without context for SAPcpmsDestinations download.
Declaration
Swift
open func restore(sapURLSession: SAPURLSession, settingsParameters: SAPcpmsSettingsParameters, completionHandler: @escaping ([OnboardingInfoKey : Any]?, Error?) -> Void)
Parameters
sapURLSession
SAPURLSession
that handles the connection to download destinationsettingsParameters
SAPcpms settings metadata to be able to concatenate the SAPcpms URL
completionHandler
called when the process finished. Error filled on failure.
-
This function resets the modifications of the SAPcpmsDestinationsDownloadStep in the SAPURLSession.
Declaration
Swift
open func reset(completionHandler: @escaping () -> Void)
Parameters
completionHandler
called when the process finished.