From 7ec8e60eff5d146dcc99118343fad41e159af84b Mon Sep 17 00:00:00 2001 From: Robin Farmer Date: Tue, 27 May 2025 14:01:40 +0200 Subject: [PATCH 1/4] add new fields and bump sdk versions. --- CHANGELOG.md | 6 ++ README.md | 18 +++++ android/build.gradle | 2 +- .../KlippaIdentityVerificationSdkPlugin.kt | 16 +++- example/ios/Runner.xcodeproj/project.pbxproj | 80 +++++++++---------- .../xcshareddata/xcschemes/Runner.xcscheme | 1 + ...tKlippaIdentityVerificationSdkPlugin.swift | 12 +++ ios/sdk_version | 2 +- lib/klippa_identity_verification_sdk.dart | 22 +++++ 9 files changed, 116 insertions(+), 43 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index defd4f2..8b7ddea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 0.2.14 + +* Bump Android to 0.7.12 +* Bump iOS to 0.6.4 +* Added `allowCameraOnNFCTask`, `exitOnRetryThresholdReached` and `nfcTimeoutThreshold` to `IdentityBuilder`. + ## 0.2.13 * Bump Android to 0.7.11 diff --git a/README.md b/README.md index a8a2966..bcc6654 100644 --- a/README.md +++ b/README.md @@ -186,6 +186,24 @@ To configure how often a user can attempt a task before the contact support butt ```dart identityBuilder.retryThreshold = 1; ``` +To configure if the SDK should quit instead of showing the support button you can set the following: +```dart +identityBuilder.exitOnRetryThresholdReached = true; +``` + +### Allow Camera On NFC Task + +To configure whether a user can skip NFC and use OCR instead. +```dart +identityBuilder.allowCameraOnNFCTask = true; +``` + +### NFC Timeout Threshold + +To configure how long the NFC detecting stays active you can set a timeout. (Currently only supports Android) +```dart +identityBuilder.nfcTimeoutThreshold = 5.0; +``` ### Language diff --git a/android/build.gradle b/android/build.gradle index 066c00f..5cc0b1c 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -69,6 +69,6 @@ android { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - def klippaIdentityVerificationVersion = project.hasProperty('klippaIdentityVerificationVersion') ? project.klippaIdentityVerificationVersion : "0.7.11" + def klippaIdentityVerificationVersion = project.hasProperty('klippaIdentityVerificationVersion') ? project.klippaIdentityVerificationVersion : "0.7.12" implementation "com.klippa:identity_verification:$klippaIdentityVerificationVersion" } diff --git a/android/src/main/kotlin/com/klippa/identity_verification/klippa_identity_verification_sdk/KlippaIdentityVerificationSdkPlugin.kt b/android/src/main/kotlin/com/klippa/identity_verification/klippa_identity_verification_sdk/KlippaIdentityVerificationSdkPlugin.kt index 516a360..a070391 100644 --- a/android/src/main/kotlin/com/klippa/identity_verification/klippa_identity_verification_sdk/KlippaIdentityVerificationSdkPlugin.kt +++ b/android/src/main/kotlin/com/klippa/identity_verification/klippa_identity_verification_sdk/KlippaIdentityVerificationSdkPlugin.kt @@ -141,6 +141,18 @@ class KlippaIdentityVerificationSdkPlugin : FlutterPlugin, MethodCallHandler, Ac identitySession.retryThreshold = retryThreshold } + call.argument("NfcTimeoutThreshold")?.let { nfcTimeoutThreshold -> + identitySession.nfcTimeoutThreshold = nfcTimeoutThreshold + } + + call.argument("AllowCameraOnNFCTask")?.let { allowCameraOnNFCTask -> + identitySession.allowCameraOnNFCTask = allowCameraOnNFCTask + } + + call.argument("ExitOnRetryThresholdReached")?.let { exitOnRetryThresholdReached -> + identitySession.exitOnRetryThresholdReached = exitOnRetryThresholdReached + } + val intent = identitySession.getIntent(activity) resultHandler = result activity.startActivityForResult(intent, REQUEST_CODE) @@ -177,7 +189,9 @@ class KlippaIdentityVerificationSdkPlugin : FlutterPlugin, MethodCallHandler, Ac IdentitySessionResultCode.DEVICE_NFC_DISABLED, IdentitySessionResultCode.TAKING_PHOTO_FAILED, IdentitySessionResultCode.UNKNOWN_ERROR, - IdentitySessionResultCode.INCORRECT_SESSION_SETUP -> identityVerificationCanceled(mappedResultCode.message()) + IdentitySessionResultCode.INCORRECT_SESSION_SETUP, + IdentitySessionResultCode.ALLOW_PICTURE_FALLBACK_DISABLED, + IdentitySessionResultCode.RETRY_LIMIT_REACHED -> identityVerificationCanceled(mappedResultCode.message()) } return true diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 5d42943..4569ea8 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -9,12 +9,12 @@ /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 5D68064C33EC95D915B56E13 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DB9067BC56822A46D3A92665 /* Pods_Runner.framework */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 905C478025554A7100106A33 /* KlippaIdentityVerification.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 905C477F25554A7100106A33 /* KlippaIdentityVerification.xcframework */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; + 9B05185D10A0DD5565E7A9A9 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CCA24F3BCC6B08E9922C1FB8 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -22,11 +22,10 @@ 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 4A6948D82D018BCC00089CF0 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = ""; }; - 6D0B49640ECC799CB7C3844F /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 7F20B48587D6CB8B5DABF0B2 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + 81BA82753C16C078CC6564E6 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 905C477F25554A7100106A33 /* KlippaIdentityVerification.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = KlippaIdentityVerification.xcframework; path = "Pods/Klippa-Identity-Verification/KlippaIdentityVerification.xcframework"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; @@ -35,8 +34,9 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 9E50C2824AF5C311E0A6D978 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; - DB9067BC56822A46D3A92665 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A5EC92F4C4EF53904C8C1FB6 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + AED141326EB70482EC808FEB /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + CCA24F3BCC6B08E9922C1FB8 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -45,7 +45,7 @@ buildActionMask = 2147483647; files = ( 905C478025554A7100106A33 /* KlippaIdentityVerification.xcframework in Frameworks */, - 5D68064C33EC95D915B56E13 /* Pods_Runner.framework in Frameworks */, + 9B05185D10A0DD5565E7A9A9 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -56,7 +56,7 @@ isa = PBXGroup; children = ( 905C477F25554A7100106A33 /* KlippaIdentityVerification.xcframework */, - DB9067BC56822A46D3A92665 /* Pods_Runner.framework */, + CCA24F3BCC6B08E9922C1FB8 /* Pods_Runner.framework */, ); name = Frameworks; sourceTree = ""; @@ -110,9 +110,9 @@ C39B3574C306087E5F5946A5 /* Pods */ = { isa = PBXGroup; children = ( - 6D0B49640ECC799CB7C3844F /* Pods-Runner.debug.xcconfig */, - 7F20B48587D6CB8B5DABF0B2 /* Pods-Runner.release.xcconfig */, - 9E50C2824AF5C311E0A6D978 /* Pods-Runner.profile.xcconfig */, + A5EC92F4C4EF53904C8C1FB6 /* Pods-Runner.debug.xcconfig */, + 81BA82753C16C078CC6564E6 /* Pods-Runner.release.xcconfig */, + AED141326EB70482EC808FEB /* Pods-Runner.profile.xcconfig */, ); path = Pods; sourceTree = ""; @@ -124,14 +124,14 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - 51CD7BDEDF9B2B6212879DFB /* [CP] Check Pods Manifest.lock */, + 172ABB3514E940ED413C5AF5 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - F1241E6A83E306EBCDFC8441 /* [CP] Embed Pods Frameworks */, - 462768B22CF9FDB0297459D4 /* [CP] Copy Pods Resources */, + 033DAFF82401A39814789372 /* [CP] Embed Pods Frameworks */, + F13DB5B50358F364A6D1D4C8 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -190,40 +190,24 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin\n"; - }; - 462768B22CF9FDB0297459D4 /* [CP] Copy Pods Resources */ = { + 033DAFF82401A39814789372 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Copy Pods Resources"; + name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - 51CD7BDEDF9B2B6212879DFB /* [CP] Check Pods Manifest.lock */ = { + 172ABB3514E940ED413C5AF5 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -245,6 +229,22 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin\n"; + }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -260,21 +260,21 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; - F1241E6A83E306EBCDFC8441 /* [CP] Embed Pods Frameworks */ = { + F13DB5B50358F364A6D1D4C8 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Embed Pods Frameworks"; + name = "[CP] Copy Pods Resources"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 5e31d3d..c53e2b3 100644 --- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -48,6 +48,7 @@ ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" debugServiceExtension = "internal" + enableGPUValidationMode = "1" allowLocationSimulation = "YES"> diff --git a/ios/Classes/SwiftKlippaIdentityVerificationSdkPlugin.swift b/ios/Classes/SwiftKlippaIdentityVerificationSdkPlugin.swift index cb2b792..133dde9 100644 --- a/ios/Classes/SwiftKlippaIdentityVerificationSdkPlugin.swift +++ b/ios/Classes/SwiftKlippaIdentityVerificationSdkPlugin.swift @@ -122,6 +122,14 @@ public class SwiftKlippaIdentityVerificationSdkPlugin: NSObject, FlutterPlugin, if let retryThreshold = builderArgs["RetryThreshold"] as? Int { builder.retryThreshold = retryThreshold } + + if let allowCameraOnNFCTask = builderArgs["AllowCameraOnNFCTask"] as? Bool { + builder.allowCameraOnNFCTask = allowCameraOnNFCTask + } + + if let exitOnRetryThresholdReached = builderArgs["ExitOnRetryThresholdReached"] as? Bool { + builder.exitOnRetryThresholdReached = exitOnRetryThresholdReached + } resultHandler = result let viewController = builder.build() @@ -152,6 +160,10 @@ public class SwiftKlippaIdentityVerificationSdkPlugin: NSObject, FlutterPlugin, return "No internet connection" case KlippaError.NfcNotSupported: return "NFC not supported" + case KlippaError.AllowPictureFallbackDisabled: + return "Allow Picture Fallback Disabled" + case KlippaError.RetryLimitReached: + return "Retry Limit Reached" } }() diff --git a/ios/sdk_version b/ios/sdk_version index 844f6a9..d2b13eb 100644 --- a/ios/sdk_version +++ b/ios/sdk_version @@ -1 +1 @@ -0.6.3 +0.6.4 diff --git a/lib/klippa_identity_verification_sdk.dart b/lib/klippa_identity_verification_sdk.dart index 10914d3..366af5b 100644 --- a/lib/klippa_identity_verification_sdk.dart +++ b/lib/klippa_identity_verification_sdk.dart @@ -75,6 +75,15 @@ class IdentityBuilder { /// The threshold the user can attempt a task before a contact support button is shown. int? retryThreshold; + /// Whether the SDK shows an additional button on the NFC screen to use OCR instead. + bool? allowCameraOnNFCTask; + + /// Whether the SDK quits instead of showing a contact support button when the `retryThreshold` was reached. + bool? exitOnRetryThresholdReached; + + // The threshold of the NFC document detection, if not document is detected within the time period the detection stops. + double? nfcTimeoutThreshold; + /// Overwrite the fonts object with [newFonts] for the builder. setFonts(KIVFonts newFonts) { this.fonts = newFonts; @@ -198,6 +207,19 @@ class KlippaIdentityVerificationSdk { parameters["RetryThreshold"] = builder.retryThreshold; } + if (builder.allowCameraOnNFCTask != null) { + parameters["AllowCameraOnNFCTask"] = builder.allowCameraOnNFCTask; + } + + if (builder.exitOnRetryThresholdReached != null) { + parameters["ExitOnRetryThresholdReached"] = + builder.exitOnRetryThresholdReached; + } + + if (builder.nfcTimeoutThreshold != null) { + parameters["NfcTimeoutThreshold"] = builder.nfcTimeoutThreshold; + } + final Map startSessionResult = await _channel.invokeMethod('startSession', parameters); return startSessionResult; From 73f73923d8798c7435e4824b903c90be86c8ce27 Mon Sep 17 00:00:00 2001 From: Robin Farmer Date: Tue, 27 May 2025 14:19:37 +0200 Subject: [PATCH 2/4] bump sdk version --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 780a668..66b4acd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: klippa_identity_verification_sdk description: Allows you to do identity verification with the Klippa Identity Verification SDK from Flutter apps. -version: 0.2.13 +version: 0.2.14 homepage: https://github.com/klippa-app/flutter-klippa-identity-verification-sdk environment: From d065e99298327eb99ad6dcd8bea1ac8a4dabea7a Mon Sep 17 00:00:00 2001 From: Robin Farmer Date: Tue, 27 May 2025 14:28:07 +0200 Subject: [PATCH 3/4] bump macos --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b115433..463fee1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,7 +40,7 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-13] + os: [macos-15] steps: - uses: actions/checkout@v2 - uses: actions/setup-java@v1 From 0eab9f5bd05e821fcd4195e9eb963cb8e7b22246 Mon Sep 17 00:00:00 2001 From: Robin Farmer Date: Tue, 27 May 2025 16:52:49 +0200 Subject: [PATCH 4/4] added nfcTimeoutThreshold support for iOS. --- README.md | 2 +- example/ios/Runner.xcodeproj/project.pbxproj | 92 +++++++++---------- ...tKlippaIdentityVerificationSdkPlugin.swift | 4 + ios/sdk_version | 2 +- 4 files changed, 52 insertions(+), 48 deletions(-) diff --git a/README.md b/README.md index bcc6654..d1e8a14 100644 --- a/README.md +++ b/README.md @@ -200,7 +200,7 @@ identityBuilder.allowCameraOnNFCTask = true; ### NFC Timeout Threshold -To configure how long the NFC detecting stays active you can set a timeout. (Currently only supports Android) +To configure how long the NFC detecting stays active you can set a timeout. ```dart identityBuilder.nfcTimeoutThreshold = 5.0; ``` diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 4569ea8..1f5a0a2 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -14,18 +14,19 @@ 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - 9B05185D10A0DD5565E7A9A9 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CCA24F3BCC6B08E9922C1FB8 /* Pods_Runner.framework */; }; + EDC811C2EC4F9FA06DC4C5B7 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EFAAD64FA968EAAEE0C119E0 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 13C27A86687E5C239201756E /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 2FAC5DEF20FE521586BC3081 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 4A6948D82D018BCC00089CF0 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 81BA82753C16C078CC6564E6 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 905C477F25554A7100106A33 /* KlippaIdentityVerification.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = KlippaIdentityVerification.xcframework; path = "Pods/Klippa-Identity-Verification/KlippaIdentityVerification.xcframework"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; @@ -34,9 +35,8 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - A5EC92F4C4EF53904C8C1FB6 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; - AED141326EB70482EC808FEB /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; - CCA24F3BCC6B08E9922C1FB8 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + E200A18C74797E1C4043E60A /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + EFAAD64FA968EAAEE0C119E0 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -45,7 +45,7 @@ buildActionMask = 2147483647; files = ( 905C478025554A7100106A33 /* KlippaIdentityVerification.xcframework in Frameworks */, - 9B05185D10A0DD5565E7A9A9 /* Pods_Runner.framework in Frameworks */, + EDC811C2EC4F9FA06DC4C5B7 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -56,7 +56,7 @@ isa = PBXGroup; children = ( 905C477F25554A7100106A33 /* KlippaIdentityVerification.xcframework */, - CCA24F3BCC6B08E9922C1FB8 /* Pods_Runner.framework */, + EFAAD64FA968EAAEE0C119E0 /* Pods_Runner.framework */, ); name = Frameworks; sourceTree = ""; @@ -110,9 +110,9 @@ C39B3574C306087E5F5946A5 /* Pods */ = { isa = PBXGroup; children = ( - A5EC92F4C4EF53904C8C1FB6 /* Pods-Runner.debug.xcconfig */, - 81BA82753C16C078CC6564E6 /* Pods-Runner.release.xcconfig */, - AED141326EB70482EC808FEB /* Pods-Runner.profile.xcconfig */, + 13C27A86687E5C239201756E /* Pods-Runner.debug.xcconfig */, + 2FAC5DEF20FE521586BC3081 /* Pods-Runner.release.xcconfig */, + E200A18C74797E1C4043E60A /* Pods-Runner.profile.xcconfig */, ); path = Pods; sourceTree = ""; @@ -124,14 +124,14 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - 172ABB3514E940ED413C5AF5 /* [CP] Check Pods Manifest.lock */, + FCDDB368174EEF8C0DB34520 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 033DAFF82401A39814789372 /* [CP] Embed Pods Frameworks */, - F13DB5B50358F364A6D1D4C8 /* [CP] Copy Pods Resources */, + AC92FC26F6D8DAFD052729D1 /* [CP] Embed Pods Frameworks */, + 813F5B163A41EF4FE9B197E7 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -190,91 +190,91 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 033DAFF82401A39814789372 /* [CP] Embed Pods Frameworks */ = { + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + name = "Thin Binary"; + outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin\n"; }; - 172ABB3514E940ED413C5AF5 /* [CP] Check Pods Manifest.lock */ = { + 813F5B163A41EF4FE9B197E7 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; + name = "[CP] Copy Pods Resources"; outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; showEnvVarsInLog = 0; }; - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( - "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); - name = "Thin Binary"; + name = "Run Script"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin\n"; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; - 9740EEB61CF901F6004384FC /* Run Script */ = { + AC92FC26F6D8DAFD052729D1 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); - inputPaths = ( + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - name = "Run Script"; - outputPaths = ( + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; }; - F13DB5B50358F364A6D1D4C8 /* [CP] Copy Pods Resources */ = { + FCDDB368174EEF8C0DB34520 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Copy Pods Resources"; + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ diff --git a/ios/Classes/SwiftKlippaIdentityVerificationSdkPlugin.swift b/ios/Classes/SwiftKlippaIdentityVerificationSdkPlugin.swift index 133dde9..4e8c94b 100644 --- a/ios/Classes/SwiftKlippaIdentityVerificationSdkPlugin.swift +++ b/ios/Classes/SwiftKlippaIdentityVerificationSdkPlugin.swift @@ -130,6 +130,10 @@ public class SwiftKlippaIdentityVerificationSdkPlugin: NSObject, FlutterPlugin, if let exitOnRetryThresholdReached = builderArgs["ExitOnRetryThresholdReached"] as? Bool { builder.exitOnRetryThresholdReached = exitOnRetryThresholdReached } + + if let nfcTimeoutThreshold = builderArgs["NfcTimeoutThreshold"] as? Double { + builder.nfcTimeoutThreshold = nfcTimeoutThreshold + } resultHandler = result let viewController = builder.build() diff --git a/ios/sdk_version b/ios/sdk_version index d2b13eb..ef5e445 100644 --- a/ios/sdk_version +++ b/ios/sdk_version @@ -1 +1 @@ -0.6.4 +0.6.5