Overview
Skill Level: Any
Prerequisites
Before you do this task you must install the UIC library in your native application. All of the modifications that you make are in your native Android application.
Step-by-step
-
Modify the defaultconfiguration.js file and set the DOM Capture options that you want to use
replay: {
// DOM Capture configuration
domCapture: {
/**
* NOTE: Enabling DOM Capture has significant implications on data
* transmission and infrastructure. This feature should be enabled
* judiciously. If enabled, it requires further configuration
* to only perform the DOM Capture based on specific events and
* elements. Refer to the documentation for more details.
*/
enabled: true,
triggers: [
{
event: "load"
}
] }
}Â
Note: In UI Capture version 5.0.0 and later, DOM Diff is automatically enabled when DOM Capture is enabled. DOM diff is not supported with Hybrid Mobile replay. Complete the following steps to disable DOM Diff:
- In the UI Capture SDK configuration, locate the domCapture service configuration object in the services object.
- Set the diffEnabled flag to false.
Example:domCapture: {
diffEnabled: false,
// DOM Capture options
options: {
maxLength: 1000000, // If this threshold is exceeded,
the snapshot will not be sent
captureFrames: true, // Should child frames/iframes
be captured
removeScripts: true // Should script tags be removed
from the captured snapshot
}
}
-
If DOM Capture does not fire on load, set DOM Capture to fire from your application by adding this code to your native Android application for the screenview that you want to capture
if (TLT === undefined) {
console.log('TLT is undefined!');
} else {
if (TLT.logScreenviewLoad === undefined) {
console.log('Could not invoke TLT.logScreenviewLoad API!');
} else {
TLT.logScreenviewLoad("root");
console.log('logScreenviewLoad:');
}
if (TLT.logDOMCapture === undefined) {
console.log('Could not invoke TLT.logDOMCapture API!');
} else {
dcid = TLT.logDOMCapture(window.document, {});
console.log('logDOMCapture:' + dcid);
}
}