System Requirements
- iOS 14.0 or higher
- Xcode 15.0 or higher
- Swift 5.9 or higher
- CocoaPods 1.10+ (if using CocoaPods)
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() when your application starts, typically in AppDelegate or the main app entry point.
configure() method initializes the Verisoul SDK with your project credentials. This method must be called once when your application starts.
Parameters:
env: The environment to use.prodfor production or.sandboxfor testingprojectId: Your unique Verisoul project identifier
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
Reinitialize Session
Thereinitialize() method generates a fresh session ID and resets the SDK’s data collection. This is essential for maintaining data integrity when user context changes.
Example:
session() to retrieve the new session identifier.
