TelemetryService
@objc(SAPBTPSDKTelemetryService)
public class TelemetryService : NSObject
extension TelemetryService: UserEventObserving
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?#>)
-
Static constant property that provides access to the TelemetryService singleton class.
Declaration
Swift
@objc public static let shared: TelemetryService
-
Read-only access to TelemetryService store which is responsible for storing and retrieving telemetry records.
Declaration
Swift
private(set) public var store: UsageStore? { get }
-
Conveys server specified value of application ID and server URL as target for telemetry upload.
Declaration
Swift
public var sapcpmsSettingsParameters: SAPcpmsSettingsParameters? { get set }
-
Configure the Telemetry Service for making it work
Declaration
Swift
public func configure(urlSession: SAPURLSession, telemetryUploadKey: String, settingsParameters: SAPcpmsSettingsParameters)
Parameters
urlSession
Pass the SAPURLSession instance associated with onboarding session.
telemetryUploadKey
API Key to upload the telemetry data to server
settingsParameters
Pass the current user SAPcpmsSettingsParameters
-
Method to store an Event in Telemetry store and then to upload it.
Declaration
Swift
public func storeCustomEvent(key: String, date: Date, duration: Double?) throws
Parameters
key
Event name
date
date information
duration
event duration
-
Declaration
Swift
public func userAdded(with onboardingID: UUID)
-
Declaration
Swift
public func userSwitched(to onboardingID: UUID)