collectAsync

fun collectAsync(callback: (String) -> Unit, timeout: Long = 15000)

Asynchronous method used to collect profiling information, with a callback function to process the profiling data.
Unlike collect(), collectAsync() waits (up to timeout) for outstanding components before collecting, so it is more likely to include biometrics such as key inputs and touch movements, and permissions granted by the user.

Parameters

callback

(String) -> Unit, invoked with the profiling data blob (base64 string)

timeout

Long, default 15000 (15 seconds); once reached, the callback is triggered regardless of whether profiling is done

Example

fun dwnApiCall(fp: String) {
Log.i(TAG, "Got FP String: $fp")
}

// activity is important for sdk profiling, it has to pass either in constructor or start()
val sdk = DwnProfilingSDK()
sdk.start(config, activity)
val callback: (String) -> Unit = { fp: String -> dwnApiCall(fp) }
sdk.collectAsync(callback)