SAPcpmsRecord
public class SAPcpmsRecord
This helper class is capable of producing usage records with SAPcpms required fields.
-
Info key used in the SAPcpmsRecord.
Declaration
Swift
public static let applicationIdentifierKey: String
-
Info key used in the SAPcpmsRecord.
Declaration
Swift
public static let applicationVersionKey: String
-
Info key used in the SAPcpmsRecord.
Declaration
Swift
public static let typeKey: String
-
Info key used in the SAPcpmsRecord.
Declaration
Swift
public static let durationKey: String
-
Info key used in the SAPcpmsRecord.
Declaration
Swift
public static let screenKey: String
-
Info key used in the SAPcpmsRecord.
Declaration
Swift
public static let viewKey: String
-
Info key used in the SAPcpmsRecord.
Declaration
Swift
public static let elementKey: String
-
Info key used in the SAPcpmsRecord.
Declaration
Swift
public static let actionKey: String
-
Info key used in the SAPcpmsRecord.
Declaration
Swift
public static let behaviorKey: String
-
Info key used in the SAPcpmsRecord.
Declaration
Swift
public static let casesKey: String
-
Info key used in the SAPcpmsRecord.
Declaration
Swift
public static let categoryKey: String
-
Info key used in the SAPcpmsRecord.
Declaration
Swift
public static let resultKey: String
-
Info key used in the SAPcpmsRecord.
Declaration
Swift
public static let unitKey: String
-
Info key used in the SAPcpmsRecord.
Declaration
Swift
public static let measurementKey: String
-
Info key used in the SAPcpmsRecord.
Declaration
Swift
public static let valueKey: String
-
Info key used in the SAPcpmsRecord.
Declaration
Swift
public static let othersKey: String
-
Creates an usage record representing a session start event.
The report will contain:
- new session identifier in UUID format
- application identifier
- application version if there is any
- device identifier
- deviceModel (such as iPhone)
- system name, such as iOS
- system version
If the reporter is disabled this method does nothing.
Declaration
Swift
public class func sessionStart(applicationIdentifier: String, applicationVersion: String? = nil) -> UsageRecord
-
Creates an usage record representing a session end event.
Declaration
Swift
public class func sessionEnd() -> UsageRecord
-
event(type:key:date:duration:screen:view:element:action:behaviour:case:category:result:unit:measurement:value:others:)
Creates a SAPcpms usage record. All the fields have default values associated with them.
Declaration
Swift
public class func event(type: String? = nil, key: String = "Other", date: Date = Date(), duration: Double? = nil, screen: String? = nil, view: String? = nil, element: String? = nil, action: String? = nil, behaviour: String? = nil, case: String? = nil, category: String? = nil, result: String? = nil, unit: String? = nil, measurement: String? = nil, value: String? = nil, others: Any? = nil) -> UsageRecord
Parameters
type
type of the record
key
key of the record, default is ‘Other’
date
date (time) of the record, default is ‘Date()’
duration
duration of the event
screen
screen parameter
view
view parameter
element
element parameter
action
action parameter
behaviour
behaviour parameter
case
case parameter
category
category parameter
result
result parameter
unit
unit parameter
measurement
measurement parameter
value
value parameter
-
eventStart(type:key:date:duration:screen:view:element:action:behaviour:case:category:result:unit:measurement:value:others:)
Creates a SAPcpms usage record. All the fields have default values associated with them.
Declaration
Swift
public class func eventStart(type: String? = nil, key: String = "Other", date: Date = Date(), duration: Double? = nil, screen: String? = nil, view: String? = nil, element: String? = nil, action: String? = nil, behaviour: String? = nil, case: String? = nil, category: String? = nil, result: String? = nil, unit: String? = nil, measurement: String? = nil, value: String? = nil, others: Any? = nil) -> UsageRecord
Parameters
type
type of the record
key
key of the record, default is ‘Other’
date
date (time) of the record, default is ‘Date()’
duration
duration of the event
screen
screen parameter
view
view parameter
element
element parameter
action
action parameter
behaviour
behaviour parameter
case
case parameter
category
category parameter
result
result parameter
unit
unit parameter
measurement
measurement parameter
value
value parameter
-
eventEnd(type:key:date:duration:screen:view:element:action:behaviour:case:category:result:unit:measurement:value:others:)
Creates a SAPcpms usage record. All the fields have default values associated with them.
Declaration
Swift
public class func eventEnd(type: String? = nil, key: String = "Other", date: Date = Date(), duration: Double? = nil, screen: String? = nil, view: String? = nil, element: String? = nil, action: String? = nil, behaviour: String? = nil, case: String? = nil, category: String? = nil, result: String? = nil, unit: String? = nil, measurement: String? = nil, value: String? = nil, others: Any? = nil) -> UsageRecord
Parameters
type
type of the record
key
key of the record, default is ‘Other’
date
date (time) of the record, default is ‘Date()’
duration
duration of the event
screen
screen parameter
view
view parameter
element
element parameter
action
action parameter
behaviour
behaviour parameter
case
case parameter
category
category parameter
result
result parameter
unit
unit parameter
measurement
measurement parameter
value
value parameter