About the Sample App
The Verisoul Flutter SDK is a demonstration project that showcases Verisoul’s fake user detection technology in a Flutter environment. The app includes:- Complete integration of Verisoul’s SDK for Flutter applications
- Touch event tracking for both Android and iOS platforms
- Cross-platform fraud detection capabilities
Prerequisites
Before you begin, you’ll need:- Flutter development environment set up
- For Android: Android Studio and Android SDK
- For iOS: Xcode and CocoaPods
- A Verisoul Project ID (obtain this by scheduling a call)
Installation Steps
1. Add the Dependency
Add the Verisoul SDK to your project by updating yourpubspec.yaml file:
2. Android Configuration
Update Minimum SDK Version
Update the Android minimum SDK version to 24 in yourandroid/app/build.gradle file:
Add Maven Repository (if needed)
If you encounter build issues with theai.verisoul:android package, add this Maven repository to your android/build.gradle file:
3. iOS Configuration
Add App Attest Capability
To fully utilize Verisoul SDK on iOS:- Open your iOS project in Xcode
- Add the App Attest capability to your project
- Update your app’s entitlements file:
Add Privacy Manifest
Create aPrivacyInfo.xcprivacy file in your iOS project with the required privacy settings for device ID collection and system boot time API access.
4. Web Support
Add the Verisoul script to yourweb/index.html:
- : Use either
prodorsandbox - : Your project ID, which must match the environment
Content Security Policy (CSP)
If your application has a Content Security Policy, update it to include the following Verisoul domains:5. Implementation
Initialize the SDK
Initialize the Verisoul SDK in your main.dart file:Get Session ID
Retrieve the session ID when needed:Provide Touch Events
Wrap your App withVerisoulWrapper:
Reinitialize
CallingVerisoulSdk.reinitialize() generates a new session_id, which ensures that if a user logs out of one account and into a different account, Verisoul will be able to delineate each account’s data cleanly.
SetAccountData (Web-only)
ThesetAccountData() function provides a simplified way to send user account information to Verisoul directly from the client side. While easy to integrate, this method has important limitations:
- Offline analysis only: Data sent via setAccountData() is only visible in the Verisoul dashboard
- No real-time decisions: Unlike the server-side API, this method doesn’t allow your application to receive and act on Verisoul’s risk scores in real-time
- Limited use case: Designed specifically for initial pilots and evaluation purposes
6. Platform-Specific Setup
Android Touch Events
For Android, modify yourMainActivity.kt file to track touch events:
What to Expect
Once integrated, the Verisoul Flutter SDK will:- Collect touch events and device motion data on both Android and iOS
- Generate a session ID for risk assessment
- Upload necessary data to Verisoul’s backend
- Provide cross-platform fraud detection for your Flutter application
