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 iOS | What 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. |
| CocoaPods | The 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
| Module | Package | Replaces in ios/Podfile | Replaces in android/app/build.gradle |
|---|---|---|---|
| Device Intelligence (Fisherman) | flutter_idensic_mobile_sdk_fisherman | IDENSIC_WITH_FISHERMAN | com.sumsub.sns:idensic-mobile-sdk-fisherman |
| MRTDReader (NFC) | flutter_idensic_mobile_sdk_nfc | IDENSIC_WITH_MRTDREADER, IDENSIC_WITH_MRTDREADER_COMPAT | com.sumsub.sns:idensic-mobile-sdk-nfc |
| VideoIdent | flutter_idensic_mobile_sdk_videoident | IDENSIC_WITH_VIDEOIDENT, IDENSIC_WITH_VIDEOIDENT_COMPAT | com.sumsub.sns:idensic-mobile-sdk-videoident |
| eID | flutter_idensic_mobile_sdk_eid | IDENSIC_WITH_EID | com.sumsub.sns:idensic-mobile-sdk-eid |
The packages work with both Swift Package Manager and CocoaPods.
Migration steps
- 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.1The 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
ImportantEach module package requires the plugin of exactly the same version. Always update the plugin and the module packages together.
- Remove all
ENV['IDENSIC_WITH_*']lines fromios/Podfile.
# Remove these lines
ENV['IDENSIC_WITH_FISHERMAN'] = 'true'
ENV['IDENSIC_WITH_MRTDREADER'] = 'true'
ENV['IDENSIC_WITH_VIDEOIDENT'] = 'true'
ENV['IDENSIC_WITH_EID'] = 'true'- 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:..."
}-
Keep the platform setup that the modules need. It has not changed:
- MRTDReader (NFC): the
Near Field Communication Tag Readingcapability and theInfo.plistkeys. See MRTDReader (NFC). - VideoIdent: the
Background Modescapability. See VideoIdent. - eID: the private Maven repository credentials in
allprojectsinandroid/build.gradle.ktsfor Android and in~/.netrcfor iOS. Swift Package Manager downloads the eID module from the same private repository, so~/.netrcis required with both Swift Package Manager and CocoaPods. See eID.
- MRTDReader (NFC): the
-
Fetch the dependencies and rebuild the app.
flutter pub get
flutter build ios
flutter build apkStaying 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: falseWith 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-UniversalorTwilioVideo, remove the_COMPATflag 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
_COMPATflag, and do not add the package for that module.
ImportantDo not combine a
_COMPATflag with the package of the same module. CocoaPods then has to resolve two versions ofOpenSSL-UniversalorTwilioVideo, andpod installfails.
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/PodfileenablesIDENSIC_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_nfcand remove theIDENSIC_WITH_*lines fromios/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/PodfileenablesIDENSIC_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.
Updated 17 hours ago