Skip to main content

Overview

The Dataspike Mobile SDK enables you to embed a full identity verification flow directly into your mobile application. It is built on an embedded Flutter module and supports native iOS, Android, and Flutter integrations.
PlatformMinimum Version
AndroidSDK 21+
iOS16.0+

Prerequisites

Before integrating the SDK, complete these steps:
1

Install Flutter

Install Flutter on your development machine using the official documentation.For Android, you can alternatively follow the AAR-based setup.
2

Get your API token

Create an account and obtain your API token from the Dataspike Dashboard.
3

Create a verification

Use the Create Verification endpoint to generate a verification_url_id (also referred to as shortId).

iOS Integration

1. Add the Flutter module

From your iOS project root, add the SDK as a Git submodule:
mkdir -p DataspikeModule
git submodule add -b main https://github.com/dataspike-io/MobileSDK-Flutter.git DataspikeModule/dataspike_module
git submodule update --init --recursive
cd DataspikeModule/dataspike_module/dataspike_module
flutter pub get
cd -

2. Configure CocoaPods

Update your Podfile following the example Podfile or the Flutter Podfile guide. The following permission flags are required in your Podfile build settings:
'PERMISSION_CAMERA=1',
'PERMISSION_PHOTOS=1',
Then install dependencies:
pod install --repo-update
We recommend creating a separate iOS target dedicated to verification with its own scheme and Pod configuration. This prevents simulator build failures and keeps your main app target stable. See Target Configuration for details.

3. Configure Xcode

Disable User Script Sandboxing: Open Xcode → Target → Build Settings and set User Script Sandboxing to NO. Add required permissions to your Info.plist:
KeyRequired
NSCameraUsageDescriptionAlways
NSPhotoLibraryUsageDescriptionAlways
NSMotionUsageDescriptionAlways
NSLocalNetworkUsageDescriptionDebug only
NSBonjourServicesDebug only
For NSBonjourServices, add the values _dartVmService._tcp and _googlecast._tcp.

4. Start the verification flow

channel.setMethodCallHandler { call, result in
  if call.method == "onVerificationCompleted" {
    if let args = call.arguments as? [String: String] {
      if args["status"] == "Completed" {
        flutterVC.dismiss(animated: true, completion: nil)
      }
    }
    result(nil)
  } else {
    result(FlutterMethodNotImplemented)
  }
}

present(flutterVC, animated: true) {
  channel.invokeMethod("startDataspikeFlow", arguments: [
    "dsApiToken": "your_token",
    "shortId": "your_short_id",
    "isDebug": true // set to false for production
  ])
}
For a complete implementation, see the example ViewController or the Flutter engine guide.

5. Update the submodule

To update the SDK to a specific version:
cd DataspikeModule/dataspike_module
git fetch
git checkout <commit_or_tag>
cd -
git add DataspikeModule/dataspike_module
git commit -m "Update DataspikeModule"

Android Integration

1. Add the Flutter module

From your Android project root:
mkdir -p DataspikeModule
git submodule add -b main https://github.com/dataspike-io/MobileSDK-Flutter.git DataspikeModule/dataspike_module
git submodule update --init --recursive
cd DataspikeModule/dataspike_module/dataspike_module
flutter pub get
cd -

2. Configure settings.gradle

Update your settings.gradle.kts to include the Flutter module:
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.PREFER_PROJECT)
    repositories {
        google()
        mavenCentral()
    }
}

rootProject.name = "YourProjectName"
include(":app")

val filePath = settingsDir.toString() +
  "/DataspikeModule/dataspike_module/dataspike_module/.android/include_flutter.groovy"
apply(from = File(filePath))
See the example settings.gradle or the Flutter guide.

3. Update build.gradle

Follow the example build.gradle or the Flutter guide.

4. Add permissions

Add these permissions to your AndroidManifest.xml:
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/>

5. Start the verification flow

channel.setMethodCallHandler { call, result ->
  if (call.method == "onVerificationCompleted") {
    val args = call.arguments as? Map<*, *>
    val status = args?.get("status")
    if (status == "Completed") {
      // Handle completion
    }
    result.success(null)
  } else {
    result.notImplemented()
  }
}

channel.invokeMethod(
  "startDataspikeFlow",
  mapOf(
    "dsApiToken" to "your_token",
    "shortId" to "your_short_id",
    "isDebug" to true // set to false for production
  )
)
For a complete implementation, see the example Activity or the Flutter guides for Flutter Screen and Flutter Fragment.
Flutter supports AOT builds only for armeabi-v7a, arm64-v8a, and x86_64. If your app supports additional ABIs (e.g. mips, x86), you may encounter integration issues. See the Flutter ABI documentation.

Flutter Integration

Example projects: In-repo example · Standalone example

1. Add the dependency

Add the SDK to your pubspec.yaml:
dependencies:
  flutter:
    sdk: flutter
  dataspikemobilesdk:
    git:
      url: https://github.com/dataspike-io/MobileSDK-Flutter
      ref: 1.0.0

2. Configure platform permissions

Add to your Info.plist:
  • NSCameraUsageDescription
  • NSPhotoLibraryUsageDescription
  • NSMotionUsageDescription
  • NSLocalNetworkUsageDescription (Debug only)
Add to your Podfile build settings (example):
'PERMISSION_CAMERA=1',
'PERMISSION_PHOTOS=1',

3. Start the verification flow

import 'package:dataspikemobilesdk/dataspikemobilesdk.dart';

final _dataspikemobilesdkPlugin = Dataspikemobilesdk();

_dataspikemobilesdkPlugin.startDataspikeFlow(
  context: context,
  dependencies: .new(
    isDebug: true, // set to false for production
    dsApiToken: "your_token",
    shortId: "your_short_id",
  ),
  callback: (status) {
    // Handle verification result
  },
);
On Apple Silicon machines, Flutter-based integration may require running Xcode under Rosetta for proper testing and dependency compatibility.

Verification Statuses

The onVerificationCompleted callback returns one of the following statuses:
StatusDescription
CompletedThe verification flow finished successfully.
ExpiredThe verification session expired before completion.
FailedThe verification flow encountered an error.

Known Limitations

Verification is fully supported only on real devices. iOS simulators may not work correctly. Simulator support improvements are planned for future releases.
In Debug configuration, image loading during verification may be significantly slower. Always test the verification flow using the Release build configuration for accurate performance.
To prevent simulator build failures, create a separate iOS target for verification:
target 'MainApp' do
  # Regular pods only
end

target 'MainAppVerification' do
  pod 'DataSpikeMobileSDK'
end
This keeps device-only dependencies isolated from your main app target and CI pipelines.
Flutter supports AOT builds only for armeabi-v7a, arm64-v8a, and x86_64. Remove unsupported ABIs like mips or x86 from your project configuration.

Troubleshooting

If Flutter debugging doesn’t work correctly, set up the LLDB init file following the official guide.You may also need to set the iOS platform version in the Flutter module podspec:
s.platform = :ios, '16.0'
Flutter tools require local network access for the Dart VM Service. Ensure the required permissions are added to your Info.plist and allowed in iOS system settings. See the official documentation.
On Apple Silicon Macs, you may encounter simulator architecture issues. Follow the official guide to exclude arm64 for iOS simulators or adjust CocoaPods build settings.