capacitor-microblink 0.0.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,6 +13,7 @@ Pod::Spec.new do |s|
13
13
  s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
14
14
  s.ios.deployment_target = '16.0'
15
15
  s.dependency 'Capacitor'
16
+ s.dependency 'BlinkCard', '2.12.0'
16
17
  s.dependency 'MicroblinkPlatform', '1.7.0'
17
18
  s.swift_version = '5.9'
18
19
  end
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Otto The Agent
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/Package.swift CHANGED
@@ -11,7 +11,8 @@ let package = Package(
11
11
  ],
12
12
  dependencies: [
13
13
  .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.1"),
14
- .package(url: "https://github.com/MicroblinkPlatform/microblink-platform-ios.git", from: "1.7.0")
14
+ .package(url: "https://github.com/BlinkCard/blinkcard-ios.git", .upToNextMajor(from: "3000.0.0"))
15
+
15
16
  ],
16
17
  targets: [
17
18
  .target(
@@ -19,7 +20,7 @@ let package = Package(
19
20
  dependencies: [
20
21
  .product(name: "Capacitor", package: "capacitor-swift-pm"),
21
22
  .product(name: "Cordova", package: "capacitor-swift-pm"),
22
- .product(name: "MicroblinkPlatform", package: "microblink-platform-ios")
23
+ .product(name: "BlinkCardUX", package: "blinkcard-ios")
23
24
  ],
24
25
  path: "ios/Sources/MicroblinkPlugin"),
25
26
  .testTarget(
package/README.md CHANGED
@@ -13,28 +13,45 @@ npx cap sync
13
13
 
14
14
  <docgen-index>
15
15
 
16
- * [`startVerification(...)`](#startverification)
16
+ * [`scanCard(...)`](#scancard)
17
+ * [`initializeBlinkCard(...)`](#initializeblinkcard)
17
18
  * [Interfaces](#interfaces)
18
- * [Type Aliases](#type-aliases)
19
19
 
20
20
  </docgen-index>
21
21
 
22
22
  <docgen-api>
23
23
  <!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
24
24
 
25
- ### startVerification(...)
25
+ ### scanCard(...)
26
26
 
27
27
  ```typescript
28
- startVerification(options: StartVerificationOptions) => Promise<StartVerificationResult>
28
+ scanCard(options: ScanCardOptions) => Promise<ScanCardResult>
29
29
  ```
30
30
 
31
- Starts Microblink identity verification flow.
31
+ Starts BlinkCard card scanning flow.
32
32
 
33
- | Param | Type |
34
- | ------------- | ----------------------------------------------------------------------------- |
35
- | **`options`** | <code><a href="#startverificationoptions">StartVerificationOptions</a></code> |
33
+ | Param | Type |
34
+ | ------------- | ----------------------------------------------------------- |
35
+ | **`options`** | <code><a href="#scancardoptions">ScanCardOptions</a></code> |
36
36
 
37
- **Returns:** <code>Promise&lt;<a href="#startverificationresult">StartVerificationResult</a>&gt;</code>
37
+ **Returns:** <code>Promise&lt;<a href="#scancardresult">ScanCardResult</a>&gt;</code>
38
+
39
+ --------------------
40
+
41
+
42
+ ### initializeBlinkCard(...)
43
+
44
+ ```typescript
45
+ initializeBlinkCard(options: InitializeBlinkCardOptions) => Promise<InitializeBlinkCardResult>
46
+ ```
47
+
48
+ Initializes BlinkCard SDK/license before scanning.
49
+
50
+ | Param | Type |
51
+ | ------------- | --------------------------------------------------------------------------------- |
52
+ | **`options`** | <code><a href="#initializeblinkcardoptions">InitializeBlinkCardOptions</a></code> |
53
+
54
+ **Returns:** <code>Promise&lt;<a href="#initializeblinkcardresult">InitializeBlinkCardResult</a>&gt;</code>
38
55
 
39
56
  --------------------
40
57
 
@@ -42,51 +59,57 @@ Starts Microblink identity verification flow.
42
59
  ### Interfaces
43
60
 
44
61
 
45
- #### StartVerificationResult
62
+ #### ScanCardResult
46
63
 
47
- | Prop | Type |
48
- | -------------------- | --------------------------------------------------------- |
49
- | **`canceled`** | <code>boolean</code> |
50
- | **`transactionId`** | <code>string \| null</code> |
51
- | **`status`** | <code>'accept' \| 'review' \| 'reject'</code> |
52
- | **`cancelReason`** | <code>'userCanceled' \| 'consentDenied'</code> |
53
- | **`cardScanResult`** | <code><a href="#cardscanresult">CardScanResult</a></code> |
64
+ | Prop | Type |
65
+ | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
66
+ | **`canceled`** | <code>boolean</code> |
67
+ | **`resultState`** | <code>'empty' \| 'uncertain' \| 'valid' \| 'stageValid'</code> |
68
+ | **`processingStatus`** | <code>'success' \| 'detectionFailed' \| 'imagePreprocessingFailed' \| 'stabilityTestFailed' \| 'scanningWrongSide' \| 'fieldIdentificationFailed' \| 'imageReturnFailed' \| 'unsupportedCard'</code> |
69
+ | **`cardNumber`** | <code>string</code> |
70
+ | **`cardNumberValid`** | <code>boolean</code> |
71
+ | **`cardNumberPrefix`** | <code>string</code> |
72
+ | **`owner`** | <code>string</code> |
73
+ | **`cvv`** | <code>string</code> |
74
+ | **`iban`** | <code>string</code> |
75
+ | **`expiryDate`** | <code><a href="#blinkcarddate">BlinkCardDate</a> \| null</code> |
54
76
 
55
77
 
56
- #### CardScanResult
78
+ #### BlinkCardDate
57
79
 
58
- | Prop | Type |
59
- | ---------------- | ------------------- |
60
- | **`cardNumber`** | <code>string</code> |
61
- | **`expiryDate`** | <code>string</code> |
62
- | **`owner`** | <code>string</code> |
63
- | **`cvv`** | <code>string</code> |
80
+ | Prop | Type |
81
+ | ----------- | ------------------- |
82
+ | **`day`** | <code>number</code> |
83
+ | **`month`** | <code>number</code> |
84
+ | **`year`** | <code>number</code> |
64
85
 
65
86
 
66
- #### StartVerificationOptions
87
+ #### ScanCardOptions
67
88
 
68
- | Prop | Type |
69
- | -------------------------------- | --------------------------------------------------------------- |
70
- | **`workflowId`** | <code>string</code> |
71
- | **`url`** | <code>string</code> |
72
- | **`userId`** | <code>string</code> |
73
- | **`isProcessingStoringAllowed`** | <code>boolean</code> |
74
- | **`isTrainingAllowed`** | <code>boolean</code> |
75
- | **`note`** | <code>string</code> |
76
- | **`givenOn`** | <code>number</code> |
77
- | **`additionalRequestHeaders`** | <code><a href="#record">Record</a>&lt;string, string&gt;</code> |
78
- | **`startTransactionPath`** | <code>string</code> |
79
- | **`cancelWorkflowPath`** | <code>string</code> |
80
- | **`workflowInfoPath`** | <code>string</code> |
89
+ | Prop | Type |
90
+ | ---------------------------- | -------------------- |
91
+ | **`licenseKey`** | <code>string</code> |
92
+ | **`licensee`** | <code>string</code> |
93
+ | **`extractOwner`** | <code>boolean</code> |
94
+ | **`extractExpiryDate`** | <code>boolean</code> |
95
+ | **`extractCvv`** | <code>boolean</code> |
96
+ | **`extractIban`** | <code>boolean</code> |
97
+ | **`allowInvalidCardNumber`** | <code>boolean</code> |
98
+ | **`enableEditScreen`** | <code>boolean</code> |
81
99
 
82
100
 
83
- ### Type Aliases
101
+ #### InitializeBlinkCardResult
84
102
 
103
+ | Prop | Type |
104
+ | ----------------- | -------------------- |
105
+ | **`initialized`** | <code>boolean</code> |
85
106
 
86
- #### Record
87
107
 
88
- Construct a type with a set of properties K of type T
108
+ #### InitializeBlinkCardOptions
89
109
 
90
- <code>{
91
110
  [P in K]: T;
92
111
  }</code>
112
+ | Prop | Type |
113
+ | ---------------- | ------------------- |
114
+ | **`licenseKey`** | <code>string</code> |
115
+ | **`licensee`** | <code>string</code> |
93
116
 
94
117
  </docgen-api>
@@ -6,6 +6,9 @@ ext {
6
6
  }
7
7
 
8
8
  buildscript {
9
+ ext {
10
+ kotlin_version = '2.2.0'
11
+ }
9
12
  repositories {
10
13
  google()
11
14
  mavenCentral()
@@ -13,10 +16,12 @@ buildscript {
13
16
  }
14
17
  dependencies {
15
18
  classpath 'com.android.tools.build:gradle:8.13.0'
19
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
16
20
  }
17
21
  }
18
22
 
19
23
  apply plugin: 'com.android.library'
24
+ apply plugin: 'org.jetbrains.kotlin.android'
20
25
 
21
26
  android {
22
27
  namespace = "com.otto.microblink"
@@ -43,6 +48,9 @@ android {
43
48
  sourceCompatibility JavaVersion.VERSION_21
44
49
  targetCompatibility JavaVersion.VERSION_21
45
50
  }
51
+ kotlinOptions {
52
+ jvmTarget = '21'
53
+ }
46
54
  }
47
55
 
48
56
  repositories {
@@ -56,7 +64,8 @@ dependencies {
56
64
  implementation fileTree(dir: 'libs', include: ['*.jar'])
57
65
  implementation project(':capacitor-android')
58
66
  implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
59
- implementation "com.microblink:microblink-platform:1.7.0"
67
+ implementation("com.microblink:blinkcard-ux:3000.0.0")
68
+ implementation 'androidx.core:core-ktx:1.17.0'
60
69
  testImplementation "junit:junit:$junitVersion"
61
70
  androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
62
71
  androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
@@ -0,0 +1,29 @@
1
+ package com.otto.microblink
2
+
3
+ import android.content.Context
4
+ import com.microblink.blinkcard.core.BlinkCardSdk
5
+ import com.microblink.blinkcard.core.BlinkCardSdkSettings
6
+ import kotlinx.coroutines.CoroutineScope
7
+ import kotlinx.coroutines.Dispatchers
8
+ import kotlinx.coroutines.launch
9
+
10
+ object BlinkCardInitBridge {
11
+ @JvmStatic
12
+ fun initialize(
13
+ context: Context,
14
+ licenseKey: String,
15
+ licensee: String?,
16
+ callback: (Throwable?) -> Unit
17
+ ) {
18
+ CoroutineScope(Dispatchers.Main).launch {
19
+ val result = BlinkCardSdk.initializeSdk(
20
+ context,
21
+ BlinkCardSdkSettings(
22
+ licenseKey = licenseKey,
23
+ licensee = licensee ?: ""
24
+ )
25
+ )
26
+ callback(result.exceptionOrNull())
27
+ }
28
+ }
29
+ }