Interface Fingerprint
-
- All Implemented Interfaces:
public interface FingerprintMain entry point for the Fingerprint Android SDK.
Use FingerprintFactory to create an instance. The coroutine-based API (
suspend fun) is recommended for Kotlin callers.
-
-
Method Summary
Modifier and Type Method Description abstract UnitgetVisitorId(Function1<FingerprintResponse, Unit> listener)Retrieves the visitor ID asynchronously. abstract UnitgetVisitorId(Integer timeoutMillis, Function1<FingerprintResponse, Unit> listener)Retrieves the visitor ID asynchronously with a custom timeout. abstract UnitgetVisitorId(Function1<FingerprintResponse, Unit> listener, Function1<Error, Unit> errorListener)Retrieves the visitor ID asynchronously with separate success and error callbacks. abstract UnitgetVisitorId(Integer timeoutMillis, Function1<FingerprintResponse, Unit> listener, Function1<Error, Unit> errorListener)Retrieves the visitor ID asynchronously with a custom timeout and error handling. abstract UnitgetVisitorId(Map<String, Object> tags, Function1<FingerprintResponse, Unit> listener, Function1<Error, Unit> errorListener)Retrieves the visitor ID with custom tags for additional request context. abstract UnitgetVisitorId(Integer timeoutMillis, Map<String, Object> tags, Function1<FingerprintResponse, Unit> listener, Function1<Error, Unit> errorListener)Retrieves the visitor ID with a custom timeout and tags. abstract UnitgetVisitorId(String linkedId, Function1<FingerprintResponse, Unit> listener, Function1<Error, Unit> errorListener)Retrieves the visitor ID and associates it with a linkedId from your system. abstract UnitgetVisitorId(Integer timeoutMillis, String linkedId, Function1<FingerprintResponse, Unit> listener, Function1<Error, Unit> errorListener)Retrieves the visitor ID with a custom timeout and a linkedId. abstract UnitgetVisitorId(Map<String, Object> tags, String linkedId, Function1<FingerprintResponse, Unit> listener, Function1<Error, Unit> errorListener)Retrieves the visitor ID with tags and a linkedId. abstract UnitgetVisitorId(Integer timeoutMillis, Map<String, Object> tags, String linkedId, Function1<FingerprintResponse, Unit> listener, Function1<Error, Unit> errorListener)Retrieves the visitor ID with a custom timeout, tags, and a linkedId. abstract FingerprintResponsegetVisitorId()Retrieves the visitor ID using Kotlin coroutines. abstract FingerprintResponsegetVisitorId(Integer timeoutMillis, Map<String, Object> tags, String linkedId)Retrieves the visitor ID using Kotlin coroutines. -
-
Method Detail
-
getVisitorId
abstract Unit getVisitorId(Function1<FingerprintResponse, Unit> listener)
Retrieves the visitor ID asynchronously. Errors are silently swallowed; use an overload with errorListener for error handling.
- Parameters:
listener- Callback invoked on success with the FingerprintResponse.
-
getVisitorId
abstract Unit getVisitorId(Integer timeoutMillis, Function1<FingerprintResponse, Unit> listener)
Retrieves the visitor ID asynchronously with a custom timeout.
- Parameters:
timeoutMillis- Maximum wait time in milliseconds before a ClientTimeout error.listener- Callback invoked on success with the FingerprintResponse.
-
getVisitorId
abstract Unit getVisitorId(Function1<FingerprintResponse, Unit> listener, Function1<Error, Unit> errorListener)
Retrieves the visitor ID asynchronously with separate success and error callbacks.
- Parameters:
listener- Callback invoked on success with the FingerprintResponse.errorListener- Callback invoked on failure with the specific Error subtype.
-
getVisitorId
abstract Unit getVisitorId(Integer timeoutMillis, Function1<FingerprintResponse, Unit> listener, Function1<Error, Unit> errorListener)
Retrieves the visitor ID asynchronously with a custom timeout and error handling.
- Parameters:
timeoutMillis- Maximum wait time in milliseconds before a ClientTimeout error.listener- Callback invoked on success with the FingerprintResponse.errorListener- Callback invoked on failure with the specific Error subtype.
-
getVisitorId
abstract Unit getVisitorId(Map<String, Object> tags, Function1<FingerprintResponse, Unit> listener, Function1<Error, Unit> errorListener)
Retrieves the visitor ID with custom tags for additional request context.
- Parameters:
tags- Custom key-value pairs attached to this request (e.g.listener- Callback invoked on success with the FingerprintResponse.errorListener- Callback invoked on failure with the specific Error subtype.
-
getVisitorId
abstract Unit getVisitorId(Integer timeoutMillis, Map<String, Object> tags, Function1<FingerprintResponse, Unit> listener, Function1<Error, Unit> errorListener)
Retrieves the visitor ID with a custom timeout and tags.
- Parameters:
timeoutMillis- Maximum wait time in milliseconds before a ClientTimeout error.tags- Custom key-value pairs attached to this request.listener- Callback invoked on success with the FingerprintResponse.errorListener- Callback invoked on failure with the specific Error subtype.
-
getVisitorId
abstract Unit getVisitorId(String linkedId, Function1<FingerprintResponse, Unit> listener, Function1<Error, Unit> errorListener)
Retrieves the visitor ID and associates it with a linkedId from your system.
- Parameters:
linkedId- Your internal identifier to link this visitor (e.g.listener- Callback invoked on success with the FingerprintResponse.errorListener- Callback invoked on failure with the specific Error subtype.
-
getVisitorId
abstract Unit getVisitorId(Integer timeoutMillis, String linkedId, Function1<FingerprintResponse, Unit> listener, Function1<Error, Unit> errorListener)
Retrieves the visitor ID with a custom timeout and a linkedId.
- Parameters:
timeoutMillis- Maximum wait time in milliseconds before a ClientTimeout error.linkedId- Your internal identifier to link this visitor.listener- Callback invoked on success with the FingerprintResponse.errorListener- Callback invoked on failure with the specific Error subtype.
-
getVisitorId
abstract Unit getVisitorId(Map<String, Object> tags, String linkedId, Function1<FingerprintResponse, Unit> listener, Function1<Error, Unit> errorListener)
Retrieves the visitor ID with tags and a linkedId.
- Parameters:
tags- Custom key-value pairs attached to this request.linkedId- Your internal identifier to link this visitor.listener- Callback invoked on success with the FingerprintResponse.errorListener- Callback invoked on failure with the specific Error subtype.
-
getVisitorId
abstract Unit getVisitorId(Integer timeoutMillis, Map<String, Object> tags, String linkedId, Function1<FingerprintResponse, Unit> listener, Function1<Error, Unit> errorListener)
Retrieves the visitor ID with a custom timeout, tags, and a linkedId.
- Parameters:
timeoutMillis- Maximum wait time in milliseconds before a ClientTimeout error.tags- Custom key-value pairs attached to this request.linkedId- Your internal identifier to link this visitor.listener- Callback invoked on success with the FingerprintResponse.errorListener- Callback invoked on failure with the specific Error subtype.
-
getVisitorId
abstract FingerprintResponse getVisitorId()
Retrieves the visitor ID using Kotlin coroutines.
This function suspends the coroutine until the operation completes. On error, it throws FingerprintException containing the original Error with request ID and error type information.
Threading: This function performs blocking I/O and should be called from a background dispatcher (e.g.,
Dispatchers.IO). The work executes on the SDK's internal thread pool. For proper dispatcher management, usewithContext:withContext(Dispatchers.IO) { fingerprintJS.getVisitorId() }Cancellation: Note that cancelling the coroutine does NOT stop the underlying signal collection and network request. The work continues on the background thread. This is a known limitation of the current SDK architecture.
- Returns:
The fingerprint response containing visitor ID and metadata
-
getVisitorId
abstract FingerprintResponse getVisitorId(Integer timeoutMillis, Map<String, Object> tags, String linkedId)
Retrieves the visitor ID using Kotlin coroutines.
This function suspends the coroutine until the operation completes. On error, it throws FingerprintException containing the original Error with request ID and error type information.
Threading: This function performs blocking I/O and should be called from a background dispatcher (e.g.,
Dispatchers.IO). The work executes on the SDK's internal thread pool. For proper dispatcher management, usewithContext:withContext(Dispatchers.IO) { fingerprintJS.getVisitorId(timeoutMillis = 5000) }Cancellation: Note that cancelling the coroutine does NOT stop the underlying signal collection and network request. The work continues on the background thread. This is a known limitation of the current SDK architecture.
- Parameters:
timeoutMillis- Maximum time to wait for the operation in millisecondstags- Custom key-value pairs to associate with this identification request.linkedId- A unique identifier to link this visitor to your internal user ID.- Returns:
The fingerprint response containing visitor ID and metadata
-
-
-
-