capacitor-microblink 0.2.0 → 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.
- package/Package.swift +3 -3
- package/README.md +21 -55
- package/android/build.gradle +10 -2
- package/android/src/main/java/com/otto/microblink/BlinkCardInitBridge.kt +29 -0
- package/android/src/main/java/com/otto/microblink/MicroblinkPlugin.java +147 -299
- package/dist/docs.json +54 -201
- package/dist/esm/definitions.d.ts +12 -31
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +2 -2
- package/dist/esm/web.js +3 -3
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +3 -3
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +3 -3
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/MicroblinkPlugin/MicroblinkPlugin.swift +144 -260
- package/package.json +2 -2
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/
|
|
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,8 +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: "
|
|
23
|
-
.product(name: "MicroblinkPlatform", package: "microblink-platform-ios")
|
|
23
|
+
.product(name: "BlinkCardUX", package: "blinkcard-ios")
|
|
24
24
|
],
|
|
25
25
|
path: "ios/Sources/MicroblinkPlugin"),
|
|
26
26
|
.testTarget(
|
package/README.md
CHANGED
|
@@ -13,33 +13,15 @@ npx cap sync
|
|
|
13
13
|
|
|
14
14
|
<docgen-index>
|
|
15
15
|
|
|
16
|
-
* [`startVerification(...)`](#startverification)
|
|
17
16
|
* [`scanCard(...)`](#scancard)
|
|
17
|
+
* [`initializeBlinkCard(...)`](#initializeblinkcard)
|
|
18
18
|
* [Interfaces](#interfaces)
|
|
19
|
-
* [Type Aliases](#type-aliases)
|
|
20
19
|
|
|
21
20
|
</docgen-index>
|
|
22
21
|
|
|
23
22
|
<docgen-api>
|
|
24
23
|
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
|
|
25
24
|
|
|
26
|
-
### startVerification(...)
|
|
27
|
-
|
|
28
|
-
```typescript
|
|
29
|
-
startVerification(options: StartVerificationOptions) => Promise<StartVerificationResult>
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
Starts Microblink identity verification flow.
|
|
33
|
-
|
|
34
|
-
| Param | Type |
|
|
35
|
-
| ------------- | ----------------------------------------------------------------------------- |
|
|
36
|
-
| **`options`** | <code><a href="#startverificationoptions">StartVerificationOptions</a></code> |
|
|
37
|
-
|
|
38
|
-
**Returns:** <code>Promise<<a href="#startverificationresult">StartVerificationResult</a>></code>
|
|
39
|
-
|
|
40
|
-
--------------------
|
|
41
|
-
|
|
42
|
-
|
|
43
25
|
### scanCard(...)
|
|
44
26
|
|
|
45
27
|
```typescript
|
|
@@ -57,45 +39,24 @@ Starts BlinkCard card scanning flow.
|
|
|
57
39
|
--------------------
|
|
58
40
|
|
|
59
41
|
|
|
60
|
-
###
|
|
42
|
+
### initializeBlinkCard(...)
|
|
61
43
|
|
|
44
|
+
```typescript
|
|
45
|
+
initializeBlinkCard(options: InitializeBlinkCardOptions) => Promise<InitializeBlinkCardResult>
|
|
46
|
+
```
|
|
62
47
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
| Prop | Type |
|
|
66
|
-
| -------------------- | --------------------------------------------------------- |
|
|
67
|
-
| **`canceled`** | <code>boolean</code> |
|
|
68
|
-
| **`transactionId`** | <code>string \| null</code> |
|
|
69
|
-
| **`status`** | <code>'accept' \| 'review' \| 'reject'</code> |
|
|
70
|
-
| **`cancelReason`** | <code>'userCanceled' \| 'consentDenied'</code> |
|
|
71
|
-
| **`cardScanResult`** | <code><a href="#cardscanresult">CardScanResult</a></code> |
|
|
72
|
-
|
|
48
|
+
Initializes BlinkCard SDK/license before scanning.
|
|
73
49
|
|
|
74
|
-
|
|
50
|
+
| Param | Type |
|
|
51
|
+
| ------------- | --------------------------------------------------------------------------------- |
|
|
52
|
+
| **`options`** | <code><a href="#initializeblinkcardoptions">InitializeBlinkCardOptions</a></code> |
|
|
75
53
|
|
|
76
|
-
|
|
77
|
-
| ---------------- | ------------------- |
|
|
78
|
-
| **`cardNumber`** | <code>string</code> |
|
|
79
|
-
| **`expiryDate`** | <code>string</code> |
|
|
80
|
-
| **`owner`** | <code>string</code> |
|
|
81
|
-
| **`cvv`** | <code>string</code> |
|
|
54
|
+
**Returns:** <code>Promise<<a href="#initializeblinkcardresult">InitializeBlinkCardResult</a>></code>
|
|
82
55
|
|
|
56
|
+
--------------------
|
|
83
57
|
|
|
84
|
-
#### StartVerificationOptions
|
|
85
58
|
|
|
86
|
-
|
|
87
|
-
| -------------------------------- | --------------------------------------------------------------- |
|
|
88
|
-
| **`workflowId`** | <code>string</code> |
|
|
89
|
-
| **`url`** | <code>string</code> |
|
|
90
|
-
| **`userId`** | <code>string</code> |
|
|
91
|
-
| **`isProcessingStoringAllowed`** | <code>boolean</code> |
|
|
92
|
-
| **`isTrainingAllowed`** | <code>boolean</code> |
|
|
93
|
-
| **`note`** | <code>string</code> |
|
|
94
|
-
| **`givenOn`** | <code>number</code> |
|
|
95
|
-
| **`additionalRequestHeaders`** | <code><a href="#record">Record</a><string, string></code> |
|
|
96
|
-
| **`startTransactionPath`** | <code>string</code> |
|
|
97
|
-
| **`cancelWorkflowPath`** | <code>string</code> |
|
|
98
|
-
| **`workflowInfoPath`** | <code>string</code> |
|
|
59
|
+
### Interfaces
|
|
99
60
|
|
|
100
61
|
|
|
101
62
|
#### ScanCardResult
|
|
@@ -137,13 +98,18 @@ Starts BlinkCard card scanning flow.
|
|
|
137
98
|
| **`enableEditScreen`** | <code>boolean</code> |
|
|
138
99
|
|
|
139
100
|
|
|
140
|
-
|
|
101
|
+
#### InitializeBlinkCardResult
|
|
141
102
|
|
|
103
|
+
| Prop | Type |
|
|
104
|
+
| ----------------- | -------------------- |
|
|
105
|
+
| **`initialized`** | <code>boolean</code> |
|
|
142
106
|
|
|
143
|
-
#### Record
|
|
144
107
|
|
|
145
|
-
|
|
108
|
+
#### InitializeBlinkCardOptions
|
|
146
109
|
|
|
147
|
-
<code>{
|
|
148
110
|
[P in K]: T;
|
|
149
111
|
}</code>
|
|
112
|
+
| Prop | Type |
|
|
113
|
+
| ---------------- | ------------------- |
|
|
114
|
+
| **`licenseKey`** | <code>string</code> |
|
|
115
|
+
| **`licensee`** | <code>string</code> |
|
|
150
116
|
|
|
151
117
|
</docgen-api>
|
package/android/build.gradle
CHANGED
|
@@ -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,8 +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
|
|
60
|
-
implementation
|
|
67
|
+
implementation("com.microblink:blinkcard-ux:3000.0.0")
|
|
68
|
+
implementation 'androidx.core:core-ktx:1.17.0'
|
|
61
69
|
testImplementation "junit:junit:$junitVersion"
|
|
62
70
|
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
|
|
63
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
|
+
}
|