OnboardingSession
open class OnboardingSession
-
Onboarding ID
Declaration
Swift
public let onboardingID: UUID
-
Authentication URL
Declaration
Swift
public let authenticationURL: URL?
-
Credentials Store
Declaration
Swift
public let credentialStore: CompositeCodableStoring
-
SAPURLSession
Declaration
Swift
public let sapURLSession: SAPURLSession
-
SettingsParameters
Declaration
Swift
public let settingsParameters: SAPcpmsSettingsParameters?
-
Type of flow
Declaration
Swift
public let flowType: OnboardingFlow.FlowType
-
Presentation Delegate
Declaration
Swift
public let presentationDelegate: FlowPresentationDelegate
-
Initializer If customs
OnboardingInfoKey
s are being used, then theinit
must be overriden.Declaration
Swift
public required init(flow: OnboardingFlow)
Parameters
flow
OnboardingFlow
that contains the necessary fields (by default) -
Returns with a new OnboardingContext filled with the values from this session
Declaration
Swift
open func onboardingContext() -> OnboardingContext
-
Invalidates the OnboardingSession. After this method has been called, the SAPURLSession, the CredentialStore and other fields cannot be used - behavior is undefined if used
Declaration
Swift
open func invalidate()
-
Creates a new instance of a properly configured store manager which can be used to perform ‘unlock’ functionality by calling
openStore
or performing change passcode scenarios see:StoreManager
documentation andavailablePasscodeActions
andperformPasscodeAction
methods The default implementation uses the default values of the StoreManager and the SAPcpmsSettingsDownloadStep to load the FUIPAsscodePolicy. This method must be overriden * If the StoreManager’s defaultPasscodePolicy was changed * the policy was downloaded on other ways * the policy is stored under custom key (for example a customConfigurationTransformer
was used)Declaration
Swift
open func storeManager() throws -> StoreManager
Return Value
Configured StoreManager instance
swift // using store manager and setting the default passcode policy to nil open override func storeManager() throws -> StoreManager { let storeManager = try super.storeManager() storeManager.defaultPasscodePolicy = nil return storeManager }
-
Upload Logs
Declaration
Swift
public func uploadLogs(completionHandler: @escaping (Error?) -> Void = SAPcpmsLogUploader.defaultCompletionHandler)
Parameters
completionHandler
closure called upon completion
-
Upload the device token to the server
Declaration
Swift
public func registerDeviceToken(deviceToken: Data, withParameters parameters: SAPcpmsRemoteNotificationParameters?, completionHandler: @escaping (Error?) -> Void)
Parameters
deviceToken
the device token from application:didRegisterForRemoteNotificationsWithDeviceToken delegate
completionHandler
called after the request completes; The parameter is an Error that could be nil.
-
Unregister the existing device token from the server
Declaration
Swift
public func unregisterDeviceToken(completionHandler: @escaping (Error?) -> Void)
Parameters
completionHandler
called after the request completes; The parameter is an Error that could be nil.
-
Provide information about the notification status. This adjusts the notification status to ‘consumed’ on SAP Cloud Platform Mobile Services cockpit Reporting menu.
Declaration
Swift
public func updateNotificationStatus(userInfo: [AnyHashable: Any], completionHandler: @escaping (Error?) -> Void)
Parameters
userInfo
userInfo parameter from the ‘didReceiveRemoteNotification’ application delegate
completionHandler
called after the request completes; The parameter is an Error that could be nil.
-
Queries user roles from the server
Declaration
Swift
public func userRoles(completionHandler: @escaping (SAPcpmsUserRoles.SAPcpmsUserInfo?, Error?) -> Void)
Parameters
completionHandler
closure called upon completion
-
Logout error enum
- noResponseData: no response data received
- invalidResponse: invalid response with given status code
Declaration
Swift
public enum LogoutError : Error
-
Logs out the user on the server (invalidating the authentication tokens) Does not invalidate the OnboardingSession! The next requst should trigger an authentication automatically
Declaration
Swift
public func logout(completionHandler: @escaping (Error?) -> Void)
Parameters
completionHandler
closure called on completion