AttestationObserver

public class AttestationObserver
extension AttestationObserver: SAPURLSessionObserving

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
}