Fingerprint’s Device Intelligence platform for iOS helps you to accurately identify the devices on which your mobile app is being used. The platform also provides high-quality Smart Signals that will help you identify risky transactions before they happen. The Fingerprint Pro Demo App for iOS allows you to effortlessly experience the capabilities of our device intelligence platform.
This repository contains the source code for the Fingerprint Pro Demo App for iOS. It shall serve as a good example
- For integrating the Fingerprint Identification SDK in your iOS app;
- For best practices to follow when using the Fingerprint Identification SDK in your app;
- For creating a privacy manifest file for your app.
Get the app up and running in a few simple steps:
-
Clone the repository:
git clone https://github.com/fingerprintjs/fingerprint-device-intelligence-ios-demo.git cd fingerprint-device-intelligence-ios-demo
-
Set up the development environment:
make environment
Note
In line with the shift-left security approach, the installed pre-commit hook uses gitleaks to prevent your API keys from being inadvertently committed to the repository.
-
Open the Xcode project (
FingerprintProDemo.xcodeproj
):xed .
-
Open up the
FingerprintProDemo/Config/ConfigVariable.swift
file (⇧ + ⌘ + O
to Open Quickly) and assign your Public API Key + Region toDeveloper.apiKey
andDeveloper.region
static fields respectively. You can find the API key in your dashboard atApp Settings
>API Keys
. -
Go to
FingerprintProDemo
target settings, click Signing & Capabilities, and select your development team. -
Build and run the app on the selected simulated or real device (
⌘ + R
).
Following up on the information provided in our Getting Started Guide, you might refer to this repository for an example of:
The SDK configuration code and getVisitorIdResponse()
call are abstracted away by the DeviceIdentificationService<ClientFactory>
struct (see FingerprintProDemo/Domain/Services/DeviceIdentification), a concrete implementation of the DeviceIdentificationServiceProtocol
protocol. While creating such an abstraction layer is not mandatory, it is a good practice that improves code maintainability and testability.
The DeviceIdentificationService<ClientFactory>.fingerprintDevice()
method is called by the DeviceFingerprintViewModel
, which further passes the obtained FingerprintResponse
instance to the ClientResponseEventViewModel
. This is where the individual field values are being extracted from the response and prepared for presentation inside the EventDetailsView<Presentation, Actions>
. The view models can be found in FingerprintProDemo/Features/Home/ViewModel.
To make the most out of SwiftUI previews in Xcode, you should have full control over the data that describes the view's state. See FingerprintProDemo/PreviewContent for an example of how you can create and use a stubbed FingerprintResponse
for your previews. Likewise, the same technique can be used for writing the automated tests.
The source code in this repository is licensed under the MIT license.