What’s new
- The library and module were renamed from
FingerprintProtoFingerprint. Update your imports fromimport FingerprintProtoimport Fingerprint. - The
FingerprintProFactorytype was renamed toFingerprintFactory. Update calls such asFingerprintProFactory.getInstance(...)toFingerprintFactory.getInstance(...). - The SDK is now distributed from a new Swift Package Manager repository,
https://github.com/fingerprintjs/fingerprint-ios. Because this is a new package rather than a rename, you must remove the old package and add the new one. - The CocoaPods pod was renamed from
FingerprintProtoFingerprint-iOS. CocoaPods is still supported for now but is deprecated, see the CocoaPods section below. - The
FPJSErrorerror type was renamed toFPError. - The response object
FingerprintResponsechanged from a deeply nested shape to a flat one. Several legacy fields (confidence,ipLocation,firstSeenAt, and similar) have been removed, along with their supporting types (IPLocation,IPLocationSubdivision,IPGeoInfo, andSeenAt). requestIdis renamed toeventIdon the response.- A new
suspectScorefield of typeInt?is added to the response. - The
extendedResponseFormatconfiguration flag has been removed as v4 always returns the flat format. - The
APIError.Codeenum has been revised, with some cases removed, some renamed, and new ones added to reflect new server-side error codes. - Swift upgraded from 5.9 to 6.
- Dropped support for iOS 13.
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 iOS SDK to the latest v4 version.Swift Package Manager
v4 is distributed from a new repository,https://github.com/fingerprintjs/fingerprint-ios. Because a new repository URL is a new package for Swift Package Manager, you can’t simply bump the version:
- Remove the existing
fingerprintjs-pro-iospackage from your project. - Add the new package
https://github.com/fingerprintjs/fingerprint-ios, and set the dependency rule to Up to Next Major Version startingfrom: "4.0.0". - Resolve packages.
Package.swift, update the package URL and version:
CocoaPods
CocoaPods is still supported in v4, but the pod was renamed fromFingerprintPro to Fingerprint-iOS (the Swift Package Manager product, as mentioned above, stays Fingerprint). Update your Podfile, then run pod update:
Update imports, factory, and error type
The library and module were renamed fromFingerprintPro to Fingerprint. Update every import across your project. A project-wide Replace All in your IDE is the quickest way to do this.
FingerprintProFactory type was renamed to FingerprintFactory. Update any calls that create a client instance.
FPJSError error type was renamed to FPError. Update any typed error handling that references it.
FingerprintResponse field changes
The response object is now flat and no longer exposes the nested fields that came from the v3 response format.
Renamed
Added
Removed
The following fields are no longer part of the response:
The
IPLocation, IPLocationSubdivision, IPGeoInfo, and SeenAt structs have been removed from the SDK entirely. See IP Geolocation for a replacement available in our Smart Signals product. Indicates the location as deduced from the IP address.
Configuration changes
extendedResponseFormat has been removed. The v4 API always returns a flat response, so the extended format toggle no longer exists.
Error handling changes
TheAPIError.Code enum has been revised for v4. Some cases were removed, some renamed, and new ones added to reflect new server-side error codes. Update any exhaustive switch statements over APIError.Code to handle the current set of cases.
The complete set of APIError.Code cases in v4:
If you have an exhaustive
switch on APIError.Code, add a default branch (or handle the new cases explicitly) to avoid compile errors.
Check out these related resources:
- iOS SDK changelog
- iOS SDK reference
- iOS Quickstart
- Download our iOS demo app from App Store to see Fingerprint in action.