collect

suspend fun collect(timeoutMs: Long? = null): TSCollection

Parameters

timeoutMs

Overrides TSConfiguration.collectionTimeoutMs for this call only. Defaults to the value configured at initialize when omitted.

Throws

if initialize has not been called.

if every long-running collector (location, Wi-Fi scan, BLE scan, nearby devices, BLE peripherals) timed out before producing any data. When only some timed out, the call returns normally with TSCollection.timedOut set to true and missing fields as null.


fun collect(timeoutMs: Long? = null, onSuccess: (TSCollection) -> Unit, onError: (Exception) -> Unit)

Parameters

timeoutMs

Overrides TSConfiguration.collectionTimeoutMs for this call only. Defaults to the value configured at initialize when omitted.

onError

Receives TSCollectionTimedOutException if every long-running collector timed out, or TSNotInitializedException if initialize has not been called.