Lifecycle event reference
Events handled by Lifecycle
The following event is handled by the Lifecycle extension:
Lifecycle content request
This event represents a request to the Lifecycle extension to start or pause collecting data and is generated when the lifecycleStart
and lifecyclePause
APIs are used.
Event details
Event Type | Event Source | Paired | Direction |
---|---|---|---|
com.adobe.eventType.lifecycle | com.adobe.eventSource.requestContent | No | N/A |
Data payload definition
The following key/value pair is used in the events:
Key | Value Type | Required | Description |
---|---|---|---|
action | String | Yes | Represents the lifecycle action type and can be one of these values: start /pause |
additionalcontextdata | Map | No | Map that contains the user-supplied context data. |
Sample events
The following section displays sample lifecycle content requests.
Start Lifecycle request
Copied to your clipboard{"action": "start","additionalcontextdata": {"key1" : "value1","key2" : "value2"}}
Pause Lifecycle request
Copied to your clipboard{"action": "pause"}
Hub shared state
Lifecycle listens for the Configuration shared state events.
Events dispatched by Lifecycle
The following events are dispatched by the Lifecycle extension:
Lifecycle data content response
This event is a response from the Lifecycle module to notify lifecycle context data in which a client/module might be interested. If a callback has been registered, this event can be used to issue a callback to the user.
The event is generated by the Lifecycle extension, when the lifecycleStart
API is called when a new session is started and it contains the lifecycle data as part of lifecyclecontextdata
and previous session information. For more information about the available data, see Lifecycle Data.
Event details
Event Type | Event Source | Paired | Direction |
---|---|---|---|
com.adobe.eventType.lifecycle | com.adobe.eventSource.responseContent | No | N/A |
Data payload definition
Here are the key-value pairs in this event:
Key | Value Type | Required | Description |
---|---|---|---|
lifecyclecontextdata | Map<String,String> | Yes | The value is a map of the key-value pairs that are generated by Lifecycle. This data can be consumed by other modules that operate on the data. |
sessionevent | String | Yes | The type of event which triggered a start response. |
starttimestampmillis | Long | Yes | The start timestamp of the new session. |
maxsessionlength | Long | Yes | Maximum time in milliseconds before a session times out. The value is currently set to 7 days. This key is different from the configuration parameter, lifecycle.sessionTimeout , which specifies the timeout for a paused session. |
previoussessionstarttimestampmillis | Long | Yes | The previous session's start timestamp. If there was no previous session, the value could be 0L . |
previoussessionpausetimestampmillis | Long | Yes | The previous session's pause timestamp. If there was no previous session, the value could be 0L . |
Lifecycle application foreground
This event is a response from the Lifecycle extension to notify that the application is being displayed in the foreground. The event is generated by the Lifecycle extension when the lifecycleStart API is called, typically when the application comes to the foreground of the device.
To forward this event to the Adobe Experience Platform Edge Network, follow the steps outlined in Configure a Rule to forward Lifecycle data to Platform.
In Android, there is a 500 millisecond timeout between consecutive lifecycleStart
and lifecyclePause
events to prevent dispatching of events due to switching between Android activities.
Event details
Event Type | Event Source |
---|---|
com.adobe.eventType.lifecycle | com.adobe.eventSource.applicationLaunch |
Data payload
The Lifecycle application foreground data payload is defined by the Platform Mobile Lifecycle Details XDM field group, and includes information about the application, device, and environment when the event occurred. Please refer to Lifecycle Application Foreground data for a list of data included with this event.
Lifecycle application background
This event is a response from the Lifecycle extension to notify that the application is in the background.
The event is generated by the Lifecycle extension when:
- The
lifecyclePause
API is called, typically when the application goes to the background of the device. - The
lifecycleStart
API is called without a previous call tolifecyclePause
(such as when the application terminates unexpectedly). In this case, a Lifecycle Application Background event is dispatched just before the Lifecycle Application Foreground event, however the background event's timestamp is backdated to a time before the application previously went in the background.
To forward this event to the Adobe Experience Platform Edge Network, follow the steps outlined in Configure a Rule to forward Lifecycle data to Platform.
In Android, there is a 500 millisecond timeout between consecutive lifecycleStart
and lifecyclePause
events to prevent dispatching of events due to switching between Android activities.
Event details
Event Type | Event Source |
---|---|
com.adobe.eventType.lifecycle | com.adobe.eventSource.applicationClose |
Data payload
The Lifecycle Application Background data payload is defined by the Platform Mobile Lifecycle Details XDM field group, and includes information about the application close type and previous session length. Please refer to Lifecycle Application Background data for a list of data included with this event.