This guide will help you set up and run the Verisoul iOS Sample App, which demonstrates how to integrate Verisoul into an iOS application.

About the Sample App

The Verisoul iOS SDK is a demonstration project that showcases Verisoul’s fake user detection technology in an iOS environment. The app includes:

  • Complete integration of Verisoul’s iOS SDK
  • App attestation for security validation
  • Privacy-compliant data collection for fraud detection

Prerequisites

Before you begin, you’ll need:

  • Xcode installed on your Mac
  • iOS development knowledge
  • Apple Developer account (for App Attest capability)
  • A Verisoul Project ID (obtain this by scheduling a call)

Installation Steps

You can integrate Verisoul SDK into your iOS project using either CocoaPods or Swift Package Manager.

1. Using CocoaPods

  1. Ensure CocoaPods is installed on your machine. If not, run:
sudo gem install cocoapods
  1. Add VerisoulSDK to your Podfile:
pod 'VerisoulSDK', '~> 0.3.0'
  1. Install the SDK:
pod install
  1. Open the .xcworkspace file in Xcode to start using the SDK.

2. Using Swift Package Manager (SPM)

  1. Open your project in Xcode
  2. Go to File > Add Packages
  3. Enter the repository URL:
https://github.com/verisoul/ios-sdk.git
  1. Choose the version you wish to use and add the package

3. Set Up Required Capabilities

Add the App Attest capability to your project:

  1. In Xcode, select your project in the Project Navigator
  2. Select your target and go to the “Signing & Capabilities” tab
  3. Click the ”+” button to add a capability
  4. Search for and add “App Attest”
  5. Update your app’s entitlements file:
<key>com.apple.developer.devicecheck.appattest-environment</key>
<string>production</string> <!-- or development -->

4. Implementation

Initialize the SDK

In your AppDelegate or SceneDelegate:

import VerisoulSDK

// In AppDelegate's didFinishLaunchingWithOptions or SceneDelegate's willConnectTo
Verisoul.shared.configure(env: .prod, projectId: "YOUR_PROJECT_ID")

Get Session ID

Retrieve the session ID when needed:

do {
    let sessionId = try await Verisoul.shared.session()
    print("Session ID: \(sessionId)")
} catch {
    print("Failed to retrieve session ID: \(error)")
}

5. Add Privacy Manifest

Create a PrivacyInfo.xcprivacy file in your project with the required privacy settings. The file should include:

  • Privacy tracking settings
  • Collected data types information
  • Accessed API types

What to Expect

Once integrated, the Verisoul SDK will:

  • Collect device signals for fraud detection
  • Validate app integrity using App Attest
  • Generate a session ID for risk assessment through Verisoul’s API
  • Provide fraud prevention for your iOS application

Next Steps

After exploring the sample app, you can use it as a reference for implementing Verisoul in your own iOS applications.

For more detailed documentation, see the Verisoul Integration Guide.