SAPcpmsUsageUploader
public class SAPcpmsUsageUploader
This component is capable of collecting and uploading usage records to SAPcpms server (or custom endpoint).
-
Collection of possible errors that could occur during the upload.
See moreDeclaration
Swift
public enum UploadError : SAPError -
Collects the usage records for the given target identifier, and uploads them in the SAPcpms format to the given endpoint. After the upload a new session should be started.
Declaration
Swift
public static func upload(to settings: SAPcpmsSettingsParameters, sapURLSession: SAPURLSession, target: String = Usage.defaultTargetID, unattributedData: UsageSnapshotting? = nil, completionHandler: @escaping (Error?) -> Void = SAPcpmsUsageUploader.defaultCompletionHandler)Parameters
settingsparameters from which the endpoint is created, only the ‘backendURL’ and the ‘applicationID’ parameters are used from this parameter
sapURLSessionthe urlsession instance which will be used to upload the records
targetthe target
unattributedDataanonymous user data (optional input to send parked unattributed usage snapshot data)
completionHandlera block which will be called at the end of the upload process
-
Collects the usage records for the given target identifier, and uploads them in the SAPcpms format to the given endpoint. After the upload a new session should be started.
Declaration
Swift
public static func upload(to uploadEndPoint: URL, sapURLSession: SAPURLSession, target: String = Usage.defaultTargetID, sapcpmsSettingsParameters: SAPcpmsSettingsParameters? = nil, unattributedData: UsageSnapshotting? = nil, completionHandler: @escaping (Error?) -> Void = SAPcpmsUsageUploader.defaultCompletionHandler)Parameters
uploadEndPointthe desired upload endpoint
sapURLSessionthe urlsession instance which will be used to upload the records
targetthe target
sapcpmsSettingsParametersthe optional settings used to obtain application information for uploaded records
unattributedDataanonymous user data (optional input to send parked unattributed usage snapshot data)
completionHandlera block which will be called at the end of the upload process
-
The default completion handler for SAPcpmsUsageUploader. Logs the error with the root logger if there is any.
Declaration
Swift
public static func defaultCompletionHandler(_ error: Error?)Parameters
errorerror that will be logged