Trust Signals SDK
Public entry point for the Trust Signals SDK.
Usage:
TrustSignalsSDK.initialize(context, TSConfiguration(collectionUrl = "…"))
// Coroutine
val collection = TrustSignalsSDK.collect()
val credentials = TSCredentials(
accountId = "…",
accessToken = "…",
serviceId = "…", // UUID
unitId = "futapp-android",
interactionId = "…", // UUID or <UUID>-<sessionId>
verificationStatus = TSVerificationStatus.VERIFIED,
)
val uploaded = TrustSignalsSDK.collectAndUpload(credentials)
// Coroutine — override the configured timeout for this call only
val collectionWithTimeoutOverriden = TrustSignalsSDK.collect(timeoutMs = 5_000L)
// Coroutine — multiple accounts: collect once, upload in parallel
val uploaded = TrustSignalsSDK.collectAndUpload(
credentialsForAccount1,
credentialsForAccount2,
)
// Callback
TrustSignalsSDK.collect(onSuccess = { … }, onError = { … })
TrustSignalsSDK.collectAndUpload(credentials, onSuccess = { … }, onError = { … })
// Scheduled (WorkManager — minimum collectionInterval enforced by the OS is 15 minutes)
TrustSignalsSDK.scheduleCollections(
collectionInterval = 15.minutes,
credentialsForAccount1,
credentialsForAccount2,
)
TrustSignalsSDK.stopScheduledCollections()
Properties
Functions
Collects signals once and uploads the result to the server for each provided credentials in parallel. Signals are only collected once regardless of how many credentials are supplied.
Registers a handler that receives errors from scheduled collect-and-upload workers.
Enqueues (or replaces) one independent recurring WorkManager job per credentials entry. Each job collects and uploads signals on its own and can be cancelled individually via stopScheduledCollections. Calling again with the same account ID replaces that account's existing schedule.
Cancels all active scheduled collect-and-upload jobs across every account. Safe to call even if no jobs are running.
Cancels the scheduled collect-and-upload job for each of the given accountIds. Safe to call even if no job is running for any of the accounts.