collect
Collects comprehensive device profile information and submits it to the authentication server.
This method orchestrates the complete device profile collection process using the provided configuration block. It creates a DeviceProfileCollector with the specified configuration, executes the collection process, and automatically submits the results to the journey.
Collection Process:
Creates and configures a DeviceProfileConfig with server settings
Applies any custom configuration provided in the block parameter
Instantiates a DeviceProfileCollector with the final configuration
Executes the collection process asynchronously
Serializes the collected data to JSON format
Submits the profile data to the authentication journey
Configuration Options: The configuration block allows customization of:
Device collectors to be used for data gathering
Logger instance for debugging and monitoring
Device identifier implementation for unique device identification
Custom collection parameters and settings
Example Usage:
// Basic collection with default settings
val result = collect()
// Custom collection configuration
val result = collect {
collectors {
clear()
add(PlatformCollector())
add(HardwareCollector())
add(NetworkCollector())
add(TelephonyCollector)
add(LocationCollector())
add(BluetoothCollector)
add(BrowserCollector)
}
logger = Logger.DEBUG
deviceIdentifier = CustomDeviceIdentifier()
}Return
A Result containing the collected device profile as a JsonObject on success, or an error result if collection fails due to system limitations or permissions.
Parameters
A configuration block for customizing the device profile collection process. Uses default configuration if not provided.
See also
Throws
if required permissions are not granted for certain collectors
if the callback has not been properly initialized