4.0.0), which allowed us to introduce breaking changes and requires you to manually migrate. The new Android SDK aligns with the v4 event format. This includes renamed classes and interfaces, a flattened response format, and a revised set of error types. None of these changes affect the underlying identification and and smart signals accuracy; these are structural/API changes only.
What’s new
- The dependency coordinate changed from
com.fingerprint.android:protocom.fingerprint.android:sdk, and the public API types moved from thecom.fingerprintjs.android.fpjs_propackage tocom.fingerprint.android, dropping the legacyjs/pronaming. FingerprintJSFactoryand theFingerprintJSinterface are renamed toFingerprintFactoryandFingerprint, dropping the legacy “JS” naming.- The response object is renamed from
FingerprintJSProResponsetoFingerprintResponse, and several nested/legacy fields (confidenceScore,ipLocation,firstSeenAt, and similar) have been removed in favor of a flat response shape, along with their supporting types (ConfidenceScore,Timestamp, andIpLocation). requestIdis renamed toeventIdacross responses, errors, and exceptions.- The
extendedResponseFormatconfiguration flag has been removed as v4 always returns the flat format. - Several error classes have been removed or replaced, and new error classes have been added to reflect new server-side error codes.
- Kotlin upgraded from v1.9.25 to v2.3.20.
Migration steps
The following section outlines the necessary migration steps to complete the transition from v2 to v4.Upgrade the MAJOR package version
Update the Fingerprint Android SDK dependency to the latest v4 version in your module’sbuild.gradle (or build.gradle.kts) dependencies block. The artifact coordinate also changed from com.fingerprint.android:pro to com.fingerprint.android:sdk:
Update imports
The public API types moved to thecom.fingerprint.android package. Update every import com.fingerprintjs.android.fpjs_pro.* statement to com.fingerprint.android.*. A project-wide Replace All in your IDE is the quickest way to do this.
Class and interface renames
Several classes and interfaces were renamed to drop the legacyJS naming.
FingerprintResponse field changes
The response object is now flat and no longer exposes the nested fields that came from the old /products/identification/data/result response format.
Renamed
Added
Removed
The following fields are no longer part of the response:
The data classes
ConfidenceScore, Timestamp, and IpLocation (including the nested City, Country, Continent, and Subdivisions types) have been removed from the SDK entirely. See IP Geolocation for a replacement available in our Smart Signals product.
Configuration changes
extendedResponseFormat: Boolean has been removed. The v4 API always returns a flat response, so the extended format toggle no longer exists.
Rename requestId to eventId on Error and FingerprintException
The requestId property on both Error and FingerprintException has been renamed to eventId.
Error class changes
Removed error classes
These error classes no longer exist in v4. Remove anywhen branches or isErrorType<T>() checks that reference them.
ApiKeyExpiredUnsupportedVersionOriginNotAvailablePackageNotAuthorizedHeaderRestrictedNotAvailableForCrawlBotsNotAvailableWithoutUA
New error classes
The following error classes are new in v4 and map to new server-side error codes.
If you have an exhaustive
when on Error subtypes, add an else branch (or handle the new types explicitly) to avoid compile errors.
Check out these related resources:
- Android SDK changelog
- Android SDK reference
- Android Quickstart
- Download our Android demo app from Google Play to see Fingerprint in action.