System Requirements
- iOS 14.0 or higher
- Xcode 15.0 or higher
- Swift 5.9 or higher
- CocoaPods 1.10+ (if using CocoaPods)
- SDK Size: ~480 KB
Installation
You can install VerisoulSDK in your iOS project using either CocoaPods or Swift Package Manager.CocoaPods
To integrate VerisoulSDK with CocoaPods:- Ensure CocoaPods is installed on your machine. If not, run:
- Add VerisoulSDK to your Podfile:
- Run the following command to install the SDK:
- Open the
.xcworkspacefile in Xcode and start using the SDK.
Swift Package Manager (SPM)
To integrate VerisoulSDK using Swift Package Manager:- Open your project in Xcode.
- Go to
File > Add Packages. - Enter the repository URL for VerisoulSDK:
- Choose the version you wish to use and add the package.
iOS Device Check
To fully utilize the Verisoul SDK, you must add theApp Attest capability to your project. This capability allows the SDK to perform necessary checks and validations to ensure the integrity and security of your application.
Update your app’s entitlements file:
Usage
Initialize the SDK
Callconfigure() before you intend to retrieve a Verisoul session_id.
configure() method initializes the Verisoul SDK with your project credentials. Only initialize the SDK if you plan to retrieve a session_id and call the Verisoul API for that session.
Parameters:
env: The environment to use.prodfor production or.sandboxfor testingprojectId: Your unique Verisoul project identifierreinitialize: Whether to create a new session during configuration. Defaults tofalsecollectTouchData: Whether to begin touch and motion capture. Defaults totrue
Get Session ID
Thesession() method returns the current session identifier after the SDK has collected sufficient device data. This session ID is required to request a risk assessment from Verisoul’s API.
Important Notes:
- Session IDs are short-lived and expire after 24 hours
- The session ID becomes available once minimum data collection is complete (typically within seconds)
- You should send this session ID to your backend, which can then call Verisoul’s API to get a risk assessment
Provide Touch Events
Starting in version 0.4.71, the Verisoul SDK captures a small number of touch events together with accelerometer samples without adding any views to your app’s hierarchy. It attaches aUIGestureRecognizer to the key window with
cancelsTouchesInView, delaysTouchesBegan, and delaysTouchesEnded all set
to false, so your app continues to receive touches without cancellation or
delay.
Touch and motion capture is enabled by default: collection begins
automatically as soon as configure() is called.
To configure the SDK without starting touch and motion capture:
setTouchCaptureEnabled(_:) to limit capture to a specific flow such as
signup:
Error Codes
The SDK throwsVerisoulException with the following error codes:
Exception Structure
All errors are thrown asVerisoulException with the following properties:
