Other Classes
The following classes are available globally.
-
The AuthenticationController class is responsible for authentication management. This class provides API’s to retrieve the expiration timestamp of access token and refresh token.
See moreDeclaration
Swift
public class AuthenticationController -
Onboarding ID Store for Multiple User
See moreDeclaration
Swift
open class MultiUserOnboardingIDManager : OnboardingIDManaging -
Onboarding ID Store for a single user
See moreDeclaration
Swift
open class SingleUserOnboardingIDManager : OnboardingIDManaging -
Undocumented
See moreDeclaration
Swift
public class PasscodePolicyManager : PasscodePolicyManaging -
Undocumented
See moreDeclaration
Swift
@MainActor public class NotificationBannerView : UIView -
Onboarding step implementation of APIKey Authentication Used in the onboarding/restoring flow, this step is responsible to configure the app’s URLSession to be able to communicate with apikey authentication protected resources. Creates and registers the APIKeyAuthenticationObserver to the SAPURLSession, then sends a validation request.
See moreDeclaration
Swift
open class APIKeyAuthenticationStep : OnboardingStep -
An Onboarding step implementation which registers
AttestationObserverto theSAPURLSessionin the onboard, restore and reset passcode flow.Use this step to ensure that requests your server receives come from legitimate instances of your application.
SAP BTP SDK For iOS uses Apple’s
DeviceCheckframework to assert the legitimacy of a particular instance of your application to SAP Mobile Services from where administrators can assess the fraud risk and eventually enforce HTTP communication for asserted devices only.For more information on AppAttest: https://developer.apple.com/documentation/devicecheck/establishing_your_app_s_integrity
See moreDeclaration
Swift
public class ApplicationAttestationStep : OnboardingStep -
An
See moreOnboardingStepcapable of registering the CSRFTokenObserver in the onboard / restore flow. Use this step if you enabled CSRF Protection for your app in SAP Mobile Services.Declaration
Swift
open class SAPcpmsCSRFTokenConfigurationStep : SimpleTaskStep -
Provides an onboarding step implementation to support custom headers in Foundation. This step is used in the onboarding/restoring flow to configure the app’s URLSession, enabling it to send appropriate custom headers with configured URLs. It creates and registers the
See moreCustomHeadersObserverto theSAPURLSession.Declaration
Swift
open class CustomHeadersStep : OnboardingStep -
An OnboardingStep capable of registering the ApplicationVersionObserver in the onboard / restore flow. Use this step if you want to check if the application version is active / inactive in the mobile services.
See moreDeclaration
Swift
public class ApplicationVersionStep : SimpleTaskStep -
Instantiates an OnboardingStep capable of registering the SAPPassportObserver in the onboard / restore flow.
If you wish to use this funcionality in manual mode, you can use this one-liner instead of this class:
See moresapURLSession.register(SAPPassportObserver())Declaration
Swift
open class SAPPassportObserverConfigurationStep : SimpleTaskStep -
This step uses SAPcpmsLockandWipeObserver, which is registered with the SAPURLSession. The observer monitors the HTTP responses from the server. It also integrates with the LockAndWipeManager to register observers and handle events related to user authentication and session management. Specifically, it looks for certain headers related to lock and wipe policies, such as x-message-code - TRAFFIC_REG_LOCKED and x-message-code - TRAFFIC_REG_WIPED.
The onboardOrRestore function is central to this setup. It creates and registers the observer, ensuring that any lock or wipe policy enforcement based on the server’s response headers is handled immediately.
See moreDeclaration
Swift
public class SAPcpmsUserLockAndWipeConfigurationStep : OnboardingStep -
Instantiates an
OnboardingStepthat uses the downloadedSAPcpmsSettingsto determine the security policies set from Mobile Services and applies them.There are four types of security policies that we read and act upon in this step:
DeviceComplianceDetectionPolicyClipboardAccessPolicyPrintPolicyOpenURLPolicy
SAPcpmsSecurityPolicyApplyStepperforms the following actions during an onboard, restore, and passcode reset.- If
DeviceComplianceDetectionPolicyis set toreport: Performs a detection check and uploads the compliance status to Mobile Services. - If
DeviceComplianceDetectionPolicyis set toignore: Does not perform a detection check or upload any compliance status to Mobile Services. - If unable to determine
DeviceComplianceDetectionPolicy: Does not perform a detection check or upload any compliance status to Mobile Services. - If
ClipboardAccessPolicyis set toblocked:ClipboardProtectionEnforcerprevents cut, copy, and paste actions between this app and any other app. - If
ClipboardAccessPolicyis set tounrestricted:ClipboardProtectionEnforcerdoes not prevent cut, copy, and paste actions between this app and other apps. - If unable to determine
ClipboardAccessPolicy:ClipboardProtectionEnforcerdoes not intervene with the default app’s behavior. - If
PrintPolicyis set toblocked:PrintPolicyEnforcerprevents the printing of an app’s content. - If
OpenURLPolicyis set toblocked:OpenURLPolicyEnforcerprevents the opening of URLs in external applications. - If
PrintPolicyandOpenURLPolicyare set tounrestricted: APIs for print and opening URLs are restored.
Precondition
SAPcpmsSecurityPolicyApplyStepneeds to run anytime afterSAPcpmsSettingsDownloadStep.SAPcpmsSettingsDownloadStep, usually used indirectly throughSAPcpmsDefaultSteps.settingsDownload, will obtain the required policy information.Note
SAPcpmsSecurityPolicyApplyStepwill returnOnboardingResult.successeven if the compliance status upload fails due to a lack of network connectivity.Usage
See morepublic var onboardingSteps: [OnboardingStep] { return [ // ... CompositeStep(steps: SAPcpmsDefaultSteps.settingsDownload), CompositeStep(steps: SAPcpmsDefaultSteps.applyDuringOnboard), SAPcpmsSecurityPolicyApplyStep(), // ... ] }Declaration
Swift
open class SAPcpmsSecurityPolicyApplyStep : OnboardingStep -
Undocumented
See moreDeclaration
Swift
public class CrashReportCollectionConsent : DataCollectionConsenting -
Class that provides localized User Data Collection with Opt-in, and Opt-out alerts available for Usage Data Collection.
Manages the User Data Collection Consent Handling. The version for each user consent form will be stored in the
credentialStoreof theOnboardingContextwhich is used to decide if a newer version of the form should be presented in the next run. If a new version for the form is present, the form will be displayed in the next run to request user confirmation.Usage
See moreSimplest model - default single page forms. let dataCollectionConsentStep = DataCollectionConsentStep() Creates a localized title and body that will collect user preference for both usage and crash data collection. Customization model - allow customized single page form. let title = "Custom UsageCollectionConsent Title" let body = "Custom UsageCollectionConsent Body" let dataCollectionConsentStep = DataCollectionConsentStep(title: title, body: body) Customization model with additional page - allow customized multi page form. var spDpPage = UserConsentPageContent() spDpPage.title = "Data Privacy Details" spDpPage.body = "Your customized data privacy text" var spSecPage = UserConsentPageContent() spSecPage.title = "Security Details" spSecPage.body = "Your customized security text" let dataCollectionConsentStep = DataCollectionConsentStep(title: title, body: body, additionalUserPageContent: [spDpPage, spSecPage]) Customization model with additional page(allow customized multi page form) and customized crash report collection consent object. var spDpPage = UserConsentPageContent() spDpPage.title = "Data Privacy Details" spDpPage.body = "Your customized data privacy text" var spSecPage = UserConsentPageContent() spSecPage.title = "Security Details" spSecPage.body = "Your customized security text" let crashReportCollectionConsent = CrashReportCollectionConsent(version: <optionally give the version as String>, userConsentPagesContent: [<optionally give array of objects of type UserConsentPageContent>]) let dataCollectionConsentStep = DataCollectionConsentStep(title: title, body: body, additionalUserPageContent: [spDpPage, spSecPage], crashReportCollectionConsent: crashReportCollectionConsent) Customization model with customized usage collection consent object and customized crash report collection consent object. let usageCollectionConsent = UsageCollectionConsent(version: <optionally give the version as String>, userConsentPagesContent: [<optionally give array of objects of type UserConsentPageContent>]) let crashReportCollectionConsent = CrashReportCollectionConsent(version: <optionally give the version as String>, userConsentPagesContent: [<optionally give array of objects of type UserConsentPageContent>]) let dataCollectionConsentStep = DataCollectionConsentStep(usageCollectionConsent: usageCollectionConsent, crashReportCollectionConsent: crashReportCollectionConsent) User selection will be enacted, and will be published in context. Responses can be accessed as follows in AppDelegate onboarded delegate method using default key: if let consentForUsage = onboardingContext.info[.usageCollectionConsentResponseInfoKey] { or an alternate key if it was set on the step as: onboardingContext.info[yourDataCollectionConsentStep.usageConsentResponseInfoKey] if let consentForCrash = onboardingContext.info[.crashCollectionConsentResponseInfoKey] { or an alternate key if it was set on the step as: onboardingContext.info[yourDataCollectionConsentStep.crashConsentResponseInfoKey] Class also contains both localized and custom usage opt-in and opt-out alerts that may be used to prompt user as needed. Intended use for these helper methods: Obtain current user state: if(Usage.shared.hasConsentForUser(userUUID)) Then call whatever is appropriate for your situation. - either opt-out: DataCollectionConsentStep.UsageCollectionConsentOptOut(viewController:… or opt-in: DataCollectionConsentStep.UsageCollectionConsentOptIn(viewController:… Default opt-in model called from your app: DataCollectionConsentStep.UsageCollectionConsentOptIn(viewController: self) { response in if response { Usage.shared.consentForUser(userUUID, given: response) } } Customized opt-in model called from your app: DataCollectionConsentStep.UsageCollectionConsentOptIn(viewController: self, title: "Custom Opt-in Title", message: "Custom Opt-in Message") ... Default opt-out model called from your app: DataCollectionConsentStep.UsageCollectionConsentOptOut(viewController: self) { response in if response { Usage.shared.consentForUser(userUUID, given: !response) } } Customized opt-out model called from your app: DataCollectionConsentStep.UsageCollectionConsentOptOut(viewController: self, title: "Custom Opt-out Title", message: "Custom Opt-out Message") ...Declaration
Swift
open class DataCollectionConsentStep : OnboardingStep, FUIUserConsentViewControllerDelegate -
Undocumented
See moreDeclaration
Swift
public class UsageCollectionConsent : DataCollectionConsenting -
Use this class to encode/decode user information
See moreDeclaration
Swift
public class User : FUIUser, Codableextension User: Equatable -
This is the data source for providing the onboarded user list
See moreDeclaration
Swift
public class UserDataSource : FUIMultiUserPasscodeControllerDataSource -
The default implementation of
See moreUseManagingprotocol. This class manages users of different UUID()Declaration
Swift
public class UserManager : UserManaging