Flutter Sample App
This guide will help you set up and run the Verisoul Flutter Sample App, which demonstrates how to integrate Verisoul into a Flutter application.
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 your pubspec.yaml
file:
Run the following command to install the dependencies:
2. Android Configuration
Update Minimum SDK Version
Update the Android minimum SDK version to 24 in your android/app/build.gradle
file:
Add Maven Repository (if needed)
If you encounter build issues with the ai.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 a PrivacyInfo.xcprivacy
file in your iOS project with the required privacy settings for device ID collection and system boot time API access.
4. Implementation
Initialize the SDK
Initialize the Verisoul SDK in your main.dart file:
Get Session ID
Retrieve the session ID when needed:
Implement Touch Event Tracking
Add touch event tracking to your Flutter widgets:
5. Platform-Specific Setup
Android Touch Events
For Android, modify your MainActivity.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
Next Steps
After exploring the sample app, you can use it as a reference for implementing Verisoul in your own Flutter applications.
For more detailed documentation, see the Verisoul Integration Guide.