Monitoring API is enabled only when the SDK is initialized with LPMonitoringParams, to use this initialization refer to the Quick Start guide.
sendSDE
Use this API method to report on engagement attributes (SDEs) for a consumer in an appInstallationId context including show and accept impressions.
func sendSDE(identities: [LPMonitoringIdentity], monitoringParams: LPMonitoringParams, completion: @escaping (_ response: LPSendSDEResponse)->(), failure: @escaping (_ error: NSError)->())
Parameter | Description | Required |
---|---|---|
identities | Mandatory array of identity objects of type LPMonitoringIdentity which includes the details on the consumer and issuer. | Yes |
monitoringParams | An mandatory LPMonitoringParams with mandatory Engagement Attributes and optional PageId and entry points array. | Yes |
completion | A Completion callback with response of type LPSendSDEResponse. This response includes sessionID and visitorID for future use. | Yes |
failure | A Failure callback with an error in case the request fails. | Yes |
getEngagement
Use this API method to get an engagement for a consumer in an appInstallationId context. When calculating eligibility, the SDEs, and other parameters based on the messaging concept determine the decisions.
As an optional parameter, you can pass SDE Data, which includes Entry Points and Engagement Attributes for routing the conversation.
func getEngagement(identities: [LPMonitoringIdentity], monitoringParams: LPMonitoringParams?, completion: @escaping (_ response: LPGetEngagementResponse)->(), failure: @escaping (_ error: NSError)->())
Parameter | Description | Required |
---|---|---|
identities | Mandatory array of identity objects of type LPMonitoringIdentity which includes the details on the consumer and issuer. | No |
monitoringParams | An optional LPMonitoringParams with optional pageId, Entry Points array and Engagement Attributes. | No |
completion | A Completion callback with response of type LPGetEngagementResponse. This response includes sessionID and visitorID for future use. | Yes |
failure | A Failure callback with an error in case the request fails. | Yes |
When trying to fetch an Authenticated Engagement, the LPMonitoringIdentity parameter containing the ConsumerId is required.
sendSDE (deprecated)
This method was deprecated since SDK version 3.2.0 Use sendSDE(identity: LPMonitoringIdentity, monitoringParams: LPMonitoringParams, completion: @escaping (_ response: LPSendSDEResponse)->(), failure: @escaping (_ error: NSError)->()) instead instead.
Use this API to report on engagement attributes (SDEs) for a consumer in an appInstallationId context including show and accept impressions.
func sendSDE(consumerID: String, monitoringParams: LPMonitoringParams, completion: @escaping (_ response: LPSendSDEResponse)->(), failure: @escaping (_ error: NSError)->())
Parameter | Description | Required |
---|---|---|
consumerId | Mandatory consumer ID from the host app | Yes |
monitoringParams | A mandatory LPMonitoringParams with mandatory Engagement Attributes and optional PageId and entry points array | Yes |
completion | A Completion callback with response of type LPSendSDEResponse. This response includes sessionID and visitorID for future use | Yes |
failure | A Failure callback with an error in case the request fails | Yes |
getEngagement (deprecated)
This method was deprecated since SDK version 3.2.0 Use getEngagement(identity: LPMonitoringIdentity, monitoringParams: LPMonitoringParams?, completion: @escaping (_ response: LPGetEngagementResponse)->(), failure: @escaping (_ error: NSError)->()) instead) instead instead.
Use this method to get an engagement for a consumer in an appInstallationId context. When calculating eligibility, the decision is based on the SDEs and other parameters based on the messaging campaign concept.
As an optional parameter, you can pass SDE Data which includes Entry Points and Engagement Attributes for routing the conversation.
func getEngagement(consumerID: String?, monitoringParams: LPMonitoringParams?, completion: @escaping (_ response: LPGetEngagementResponse)->(), failure: @escaping (_ error: NSError)->())
Parameter | Description | Required |
---|---|---|
consumerId | The consumer ID from the host app | No |
monitoringParams | An optional LPMonitoringParams with optional pageId, Entry Points array and Engagement Attributes | No |
completion | A Completion callback with response of type LPGetEngagementResponse. This response includes sessionID and visitorID for future use | Yes |
failure | A Failure callback with an error in case the request fails | Yes |
Please refer to the Interface and Class Definitions section for parameter classes.