Other Classes

The following classes are available globally.

  • An observer which is responsible for obtaining the attestation token from SAP Mobile Services and adding it to each request header before being sent. The class also refreshes the token when the token expires.

    SAP BTP SDK For iOS uses Apple’s DeviceCheck framework 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

    Use this observer by simply adding it to a SAPURLSession

    do {
        // Create an instance of `AttestationService` using the initializer.
        let service = try AttestationService(sapCpmsSettingsParameters: settingsParameters,
                                         sapUrlSession: urlSession, store: persistentStore, attestationSettings: settings)
        // Create an instance of `AttestationObserver` using the service.
        let observer = AttestationObserver(attestationService: service)
        sapURLSession.register(observer)
    } catch {
        //catch error
    }
    
    See more

    Declaration

    Swift

    public class AttestationObserver
    extension AttestationObserver: SAPURLSessionObserving
  • This class is responsible for Application attestation and assertion with Apple. It also validates the results with SAP Mobile Services, establishing the legitimacy of an application.

    To be able to use this class App Attest should be supported on the Apple device.

    SAP BTP SDK For iOS uses Apple’s DeviceCheck framework 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.

    See more

    Declaration

    Swift

    public class AttestationService
  • Undocumented

    See more

    Declaration

    Swift

    public class AuxiliaryDataRequestManager
  • Undocumented

    See more

    Declaration

    Swift

    public class AuxiliaryCommunicationProvider : AuxiliaryCommunicationProviding
  • Undocumented

    See more

    Declaration

    Swift

    public class AuxiliaryDataContainer<T> : AuxiliaryDataContainerRepresenting, Codable where T : Decodable, T : Encodable
  • Undocumented

    See more

    Declaration

    Swift

    public class AuxiliaryDataRequest<T> : AuxiliaryDataRequestRepresenting, Codable where T : Decodable, T : Encodable
  • Undocumented

    See more

    Declaration

    Swift

    public class AuxiliaryKeyContainer<T> : AuxiliaryKeyContainerRepresenting where T : Decodable, T : Encodable, T : Hashable
  • A type that can be passed in to the DigitalSignatureVerifying protocol for specifying values useful in the signature verification.

    See more

    Declaration

    Swift

    public class DigitalSignatureParameter
  • This class implements DigitalSignatureVerifying and does the digital signature verification of the passed data.

    See more

    Declaration

    Swift

    public class DigitalSignatureVerifier
    extension DigitalSignatureVerifier: DigitalSignatureVerifying
  • Use this observer to detect user Lock and Wipe events from SAPcpms. When a Locked or Wiped response is detected, the provided handler is called with the specific Locked or Woped case - see LockWipePolicyError for more information. The observer is in silent mode after this detection and will remain in this mode until a non-locking or non-wiping response is detected. The observer will not call the provided handler while in silent mode. All requests that are detected as Locked or Wiped ones will result in the appropriate LockWipePolicyError error.

    See more

    Declaration

    Swift

    public class SAPcpmsLockAndWipeObserver : SAPURLSessionObserving
  • Class responsible for managing the logout process in the browser.

    Example Usage:

    Do not forget to set few things before calling logout:

    In case of OAUth or SAML Authorization (with Presenter)
    ```swift
    LogoutHandler.shared.set(sapURLSession: <SAPURLSession>)
    LogoutHandler.shared.set(settingsParameters: <SAPcpmsSettingsParameters>)
    LogoutHandler.shared.set(authenticationType: <AuthenticationType>)
    ```
    
    In case of Basic Authorization
    ```swift
    LogoutHandler.shared.set(sapURLSession: <SAPURLSession>)
    ```
    
    In case of OAuth (with External Browser)
    ```swift
    LogoutHandler.shared.set(sapURLSession: <SAPURLSession>)
    LogoutHandler.shared.set(settingsParameters: <SAPcpmsSettingsParameters>)
    LogoutHandler.shared.set(authenticationTypeForBrowser: <AuthenticationTypeForBrowser>)
    ```
    

    Do logout:

    LogoutHandler.shared.logout { error in
       if error == nil {
        // handle success case
       } else {
        // handle error case
       }
     }
    
    See more

    Declaration

    Swift

    public class LogoutHandler
    extension LogoutHandler: SAPURLSessionObserving
    extension LogoutHandler : AppDelegateObserving, SceneDelegateObserving
  • This observer checks for the response header x-app-version-inactive denoting if the current application version is active or not in mobile services and stops user from onboarding if the version is inactive.

    To enable this functionality you need to register this observer to an SAPURLSession instance.

    This is an example for a typical usage of the observer:

    let urlSession: SAPURLSession = <#SAPURLSession instance#>
    
    let applicationVersionObserver = ApplicationVersionObserver()
    urlSession.register(applicationVersionObserver)
    
    See more

    Declaration

    Swift

    open class ApplicationVersionObserver : SAPURLSessionObserving
  • Observer which performs necessary steps for API Key authentication

    See more

    Declaration

    Swift

    open class APIKeyAuthenticationObserver
    extension APIKeyAuthenticationObserver: SAPURLSessionObserving
  • Default implementation of APIKeyCredentialDiscovery

    See more

    Declaration

    Swift

    public class DefaultAPIKeyCredentialDiscovery : APIKeyCredentialDiscovery
  • TokenStoreManager is a singleton that centralizes the management of authentication tokens. It provides a centralized interface for setting and interacting with different token store implementations, allowing for flexible token management.

    See more

    Declaration

    Swift

    public class TokenStoreManager
  • Undocumented

    See more

    Declaration

    Swift

    public class DispatcherFactory
  • Use this class to broadcast your UISceneDelegate’s methods among the registered components.

    See more

    Declaration

    Swift

    public class SceneDelegateDispatcher : EventDispatching
  • A singleton class which manages scenes in Multi-window scenario.

    See more

    Declaration

    Swift

    public class SceneManager
  • Undocumented

    See more

    Declaration

    Swift

    @MainActor
    public class DefaultSAPWKUIDelegate : NSObject, WKUIDelegate
  • The default implementation of SAPPassportManaging protocol. This default implementation adheres to the standards mentioned for “metering” use-case by default. Users may choose to override the relevant methods to get/set passport fields differently and also to change the manager behavior in general.

    See more

    Declaration

    Swift

    public class MeteringPassportManager : SAPPassportManaging
  • Undocumented

    See more

    Declaration

    Swift

    public class Passport
  • CustomHeadersObserver is responsible for adding custom headers to HTTP requests made through the SAPURLSession.

    To utilize this functionality, you need to register an instance of this observer with an SAPURLSession. Here is an example of how to use the CustomHeadersObserver:

    let urlSession: SAPURLSession = <#SAPURLSession instance#>
    let headers = ["Authorization": "Bearer token", "X-Custom-Header": "value"]
    let urlMatcher = URLMatcher(pattern: "https://api.example.com/")
    
    let customHeadersObserver = CustomHeadersObserver(headers, urlMatcher)
    urlSession.register(customHeadersObserver)
    
    See more

    Declaration

    Swift

    public class CustomHeadersObserver : SAPURLSessionObserving
  • A class that implements URL matching based on a specified pattern URL.

    See more

    Declaration

    Swift

    public class MatchURL : URLMatching
  • A class that implements URL matching, which matches all URLs.

    See more

    Declaration

    Swift

    public class MatchAll : URLMatching
  • This observer is responsible to set SAP Passport header for metering. This includes the SAP-PASSPORT header field, which are added to each HTTP request of the SAPURLSession.

    To enable this functionality you need to register this observer to an SAPURLSession instance.

    This is an example for a typical usage of the observer:

    let urlSession: SAPURLSession = SAPURLSession instance
    
    let passportObserver = SAPPassportObserver( )
    urlSession.register(passportObserver)
    
    See more

    Declaration

    Swift

    open class SAPPassportObserver : SAPURLSessionObserving
  • API to enforce a ClipboardAccessPolicy

     try ClipboardProtectionEnforcer.shared.enforce(policy: .blocked)
    
     // ... during this time copied values cannot be pasted to other apps
    
     try ClipboardProtectionEnforcer.shared.enforce(policy: .unrestricted)
    
    See more

    Declaration

    Swift

    public class ClipboardProtectionEnforcer
  • APIs to detect if device is compromised

    See more

    Declaration

    Swift

    @available(iOSApplicationExtension, unavailable)
    public class DeviceComplianceChecker
  • Undocumented

    See more

    Declaration

    Swift

    public class SAPcpmsDeviceSecurityAuditUploader
  • Usage

     try OpenURLPolicyEnforcer.shared.enforce(policy: .blocked)
    
     // ... now URLs can not be opened in an external application.
    
    
    See more

    Declaration

    Swift

    public class OpenURLPolicyEnforcer
  • Usage

     try PrintPolicyEnforcer.shared.enforce(policy: .blocked)
    
    
    See more

    Declaration

    Swift

    public class PrintPolicyEnforcer
  • Undocumented

    See more

    Declaration

    Swift

    public class AuxiliarySecurityManager
  • Undocumented

    See more

    Declaration

    Swift

    public class SecurityManager
  • Undocumented

    See more

    Declaration

    Swift

    public class CryptoProviderUtil
  • The default implementation of LockAndWipeManaging protocol. This class manages LockAndWipeEvents

    See more

    Declaration

    Swift

    public class LockAndWipeManager : LockAndWipeManaging
  • class to load the encryption configuration for a given appId and deviceId

    See more

    Declaration

    Swift

    public class EncryptionConfigLoader
  • A class designed to handle the Telemetry Services. It is capable of managing the session start and end events, handling the custom telemetry events and uploading telemetry events data to a remote server.

    This class follows the Singleton pattern, ensuring a single global instance. To store a custom event, access the API like this

    Example Usage: swift TelemetryService.shared.storeCustomEvent(key: <#T##String#>, date: <#T##Date#>, duration: <#T##Double?#>)

    See more

    Declaration

    Swift

    @objc(SAPBTPSDKTelemetryService)
    public class TelemetryService : NSObject
    extension TelemetryService: UserEventObserving
  • Undocumented

    See more

    Declaration

    Swift

    public class SAPCrashReporter
    extension SAPCrashReporter: SAPCrashReporting
  • A class to dispatch the user events to store observers of type UserEventObserving. It also provides the capability to add and remove observers. These registered observers will receive notifications for user-related events, including user added and user switch.

    See more

    Declaration

    Swift

    public class UserEventDispatcher : EventDispatching
  • Undocumented

    See more

    Declaration

    Swift

    public final class SAPFoundationUtils