iOS Flutter Wrapper

Integrate IDmission's IDentity SDK into your iOS Flutter application.

Setup

  1. 1

    Set up the Flutter development environment based on your development and target OS.

    Setting up the development environment →
  2. 2

    Install the cocoapods-user-defined-build-types plugin. Do not use the system Ruby installation to install the plugin.

    Cocoapods Plugin →

    Ruby Instructions →
  3. 3

    Verify that all Flutter dependencies are installed correctly.

    Shell
    flutter doctor
  4. 4

    Download and unzip the resources archive.

    Download FlutterSDK2iOSResources →
  5. 5

    Run the following commands in your working directory to create the plugin template.

    Shell
    flutter create --template=plugin --org com.idmission.newsdkflutter --platforms=android,ios -a java -i swift flutter_plugin_identity_sdk
    cd flutter_plugin_identity_sdk
    cd example
    flutter pub upgrade
    dart migrate --apply-changes
  6. 6

    Add SDK files from the downloaded archive.

    • Flutter Dart code: From flutter_dart_code, copy the 3 dart files to the lib folder. Overwrite if required.
    • Flutter Dart project code: From flutter_dart_project_code, copy main.dart to example/lib. Overwrite if required.
    • Podspec and Podfile: From podspec, copy to the ios folder. From podfile, copy to example/ios. Overwrite if required.
  7. 7

    Set up pods. Navigate to the example/ios directory in Terminal and uninstall the existing pods.

    Shell
    pod deintegrate

    Delete Podfile.lock and Runner.xcworkspace in example/ios. Replace the Podfile with the one from the archive. Then install pods.

    Shell
    pod install
  8. 8

    Add permissions. Copy the contents of the permissions folder to example/ios/Runner. Overwrite if required.

  9. 9

    Open the project in Xcode by launching Runner.xcworkspace in example/ios.

  10. 10

    Add iOS code. In the Xcode project navigator, go to Pods/Development Pods/flutter_plugin_identity_sdk/.../../example/ios/.symlinks/plugins/flutter_plugin_identity_sdk/ios/Classes. Delete FlutterPluginIdentitySdkPlugin.swift. Drag and drop the ios_code folder contents into Classes. In the popup, select Copy items if needed, Create groups, and the flutter_plugin_identity_sdk target.

  11. 11

    Select the Runner target, then Build Phases → Run Script. Add the following on the second line of the shell script.

    Shell
    find "$BUILD_DIR" -type f -name "*.signature" -exec rm {} \;
  12. 12

    Close Xcode. Navigate to example/ios in Terminal and re-integrate pods.

    Shell
    pod deintegrate

    Delete Podfile.lock and Runner.xcworkspace again, then reinstall.

    Shell
    pod install
  13. 13

    Relaunch Runner.xcworkspace in example/ios.

  14. 14

    Navigate to Product → Scheme → Edit Scheme. Select the Run Action. Under the Info tab, set Build Configuration to Release. Uncheck the Debug Executable checkbox.

  15. 15

    Configure code signing. Select the Runner target, then Signing & Capabilities. Add your Team and Provisioning Profile.

  16. 16

    Build and run the code on an iOS device from Xcode.

Available Functions

The following functions are available after initializing the SDK.

Initidm_sdk_init

Initializes the SDK. Must be called before any other function.

Dart
idm_sdk_init(String apiBaseUrl, String debug, String accessToken)
Serviceidm_sdk_serviceID20

Initiates the ID Validation (Service ID 20) flow.

Dart
idm_sdk_serviceID20()
Serviceidm_sdk_serviceID10

Initiates the ID Validation and Match Face (Service ID 10) flow.

Dart
idm_sdk_serviceID10()
Serviceidm_sdk_serviceID185

Initiates the Identify Customer (Service ID 185) flow.

Dart
idm_sdk_serviceID185()
Serviceidm_sdk_serviceID660

Initiates the Live Face Check (Service ID 660) flow.

Dart
idm_sdk_serviceID660()
Serviceidm_sdk_serviceID50

Initiates the ID Validation and Customer Enroll (Service ID 50) flow.

Dart
idm_sdk_serviceID50(int uniqueCustomerNumber)
Serviceidm_sdk_serviceID175

Initiates the Customer Enroll Biometrics (Service ID 175) flow.

Dart
idm_sdk_serviceID175(int uniqueCustomerNumber)
Serviceidm_sdk_serviceID105

Initiates the Customer Verification (Service ID 105) flow.

Dart
idm_sdk_serviceID105(int uniqueCustomerNumber)
Submitsubmit_result

Submits the form and finalizes the current service flow.

Dart
submit_result()