Migrating modules to flutter packages

Starting with version 1.47.1, the optional modules of the Flutter plugin come as separate pub packages, the same on iOS and Android. They replace the IDENSIC_WITH_* flags in ios/Podfile and the com.sumsub.sns:idensic-mobile-sdk-<module> dependencies in android/app/build.gradle.

The plugin also supports Swift Package Manager (SPM) now. Flutter 3.44 and later uses Swift Package Manager by default, and Swift Package Manager does not read ios/Podfile, so the IDENSIC_WITH_* flags have no effect there.

Who needs to migrate

You need to migrate if your app uses any of the optional modules: Device Intelligence (Fisherman), MRTDReader (NFC), VideoIdent, or eID.

How your app builds iOSWhat happens after the update to 1.47.1
Swift Package Manager (default in Flutter 3.44 and later)The build stops with an error that names the packages to add. See Troubleshooting.
CocoaPodsThe build works, the IDENSIC_WITH_* flags still add the modules. We recommend migrating anyway.

If your app does not use any optional modules, no action is required.

Module packages

ModulePackageReplaces in ios/PodfileReplaces in android/app/build.gradle
Device Intelligence (Fisherman)flutter_idensic_mobile_sdk_fishermanIDENSIC_WITH_FISHERMANcom.sumsub.sns:idensic-mobile-sdk-fisherman
MRTDReader (NFC)flutter_idensic_mobile_sdk_nfcIDENSIC_WITH_MRTDREADER, IDENSIC_WITH_MRTDREADER_COMPATcom.sumsub.sns:idensic-mobile-sdk-nfc
VideoIdentflutter_idensic_mobile_sdk_videoidentIDENSIC_WITH_VIDEOIDENT, IDENSIC_WITH_VIDEOIDENT_COMPATcom.sumsub.sns:idensic-mobile-sdk-videoident
eIDflutter_idensic_mobile_sdk_eidIDENSIC_WITH_EIDcom.sumsub.sns:idensic-mobile-sdk-eid

The packages work with both Swift Package Manager and CocoaPods.

Migration steps

  1. Update the plugin and add a package for each module your app uses. For example, for NFC and VideoIdent:
flutter pub add flutter_idensic_mobile_sdk_plugin:^1.47.1 flutter_idensic_mobile_sdk_nfc:^1.47.1 flutter_idensic_mobile_sdk_videoident:^1.47.1

The result in pubspec.yaml:

dependencies:
  flutter_idensic_mobile_sdk_plugin: ^1.47.1
  flutter_idensic_mobile_sdk_nfc: ^1.47.1
  flutter_idensic_mobile_sdk_videoident: ^1.47.1
🚧

Important

Each module package requires the plugin of exactly the same version. Always update the plugin and the module packages together.

  1. Remove all ENV['IDENSIC_WITH_*'] lines from ios/Podfile.
# Remove these lines
ENV['IDENSIC_WITH_FISHERMAN'] = 'true'
ENV['IDENSIC_WITH_MRTDREADER'] = 'true'
ENV['IDENSIC_WITH_VIDEOIDENT'] = 'true'
ENV['IDENSIC_WITH_EID'] = 'true'
  1. Remove the module dependencies from android/app/build.gradle. The packages add them on their own.
dependencies {
    // Remove these lines
    implementation "com.sumsub.sns:idensic-mobile-sdk-fisherman:..."
    implementation "com.sumsub.sns:idensic-mobile-sdk-nfc:..."
    implementation "com.sumsub.sns:idensic-mobile-sdk-videoident:..."
    implementation "com.sumsub.sns:idensic-mobile-sdk-eid:..."
}
  1. Keep the platform setup that the modules need. It has not changed:

    • MRTDReader (NFC): the Near Field Communication Tag Reading capability and the Info.plist keys. See MRTDReader (NFC).
    • VideoIdent: the Background Modes capability. See VideoIdent.
    • eID: the private Maven repository credentials in allprojects in android/build.gradle.kts for Android and in ~/.netrc for iOS. Swift Package Manager downloads the eID module from the same private repository, so ~/.netrc is required with both Swift Package Manager and CocoaPods. See eID.
  2. Fetch the dependencies and rebuild the app.

flutter pub get
flutter build ios
flutter build apk

Staying on CocoaPods

If you cannot migrate right now, you can keep building iOS with CocoaPods. On Flutter 3.44 and later, turn Swift Package Manager off in pubspec.yaml:

flutter:
  config:
    enable-swift-package-manager: false

With CocoaPods, the IDENSIC_WITH_* flags in ios/Podfile keep working. Keep source 'https://github.com/sumsub/Specs.git' in ios/Podfile as well.

Compat variants

IDENSIC_WITH_MRTDREADER_COMPAT and IDENSIC_WITH_VIDEOIDENT_COMPAT add module variants that support older versions of OpenSSL-Universal (below 3.1.5001) and TwilioVideo (below 5.8.2). These variants are available only with CocoaPods. The flutter_idensic_mobile_sdk_nfc and flutter_idensic_mobile_sdk_videoident packages always add the current variants.

If your app uses a _COMPAT flag, choose one of the following:

  • Move to the current variant. Once your other dependencies accept the newer OpenSSL-Universal or TwilioVideo, remove the _COMPAT flag and add the package as described in Migration steps.
  • Keep the compat variant. Build iOS with CocoaPods as described in Staying on CocoaPods, keep the _COMPAT flag, and do not add the package for that module.
🚧

Important

Do not combine a _COMPAT flag with the package of the same module. CocoaPods then has to resolve two versions of OpenSSL-Universal or TwilioVideo, and pod install fails.

Troubleshooting

With Swift Package Manager, the plugin checks ios/Podfile during the build and stops if it finds flags that no longer have any effect.

Podfile flags without packages

The build fails with an error like this:

ios/Podfile enables IDENSIC_WITH_MRTDREADER, but with Swift Package Manager the Podfile no longer adds SDK modules, and the app would be built without them. Run: flutter pub add flutter_idensic_mobile_sdk_nfc and remove the IDENSIC_WITH_* lines from ios/Podfile.

Follow the Migration steps. The error lists exactly the packages that are missing.

Compat flags under Swift Package Manager

The build fails with an error like this:

ios/Podfile enables IDENSIC_WITH_MRTDREADER_COMPAT, the compat variants that only CocoaPods provides, but the app builds with Swift Package Manager, which does not read the Podfile.

See Compat variants.


Did this page help you?