react-native-okaycam 1.2.8 → 1.2.10
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/README.md +78 -68
- package/android/.gradle/6.8/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/6.8/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +1 -1
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/checksums/sha1-checksums.bin +0 -0
- package/android/build.gradle +1 -1
- package/package.json +1 -1
- package/react-native-okaycam.podspec +1 -1
package/README.md
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
# react-native-okaycam
|
|
2
2
|
|
|
3
3
|
## Requirements
|
|
4
|
+
|
|
4
5
|
### Android
|
|
6
|
+
|
|
5
7
|
- minSdkVersion >= 21
|
|
6
8
|
|
|
7
9
|
### iOS
|
|
8
|
-
- iOS 9+
|
|
9
|
-
- Swift 5
|
|
10
10
|
|
|
11
|
+
- iOS 12+
|
|
12
|
+
- Swift 5
|
|
11
13
|
|
|
12
14
|
## Getting started
|
|
13
15
|
|
|
@@ -33,7 +35,8 @@ post_install do |installer|
|
|
|
33
35
|
end
|
|
34
36
|
end
|
|
35
37
|
```
|
|
36
|
-
|
|
38
|
+
|
|
39
|
+
3. Run command `pod install`
|
|
37
40
|
|
|
38
41
|
4. Add camera permission
|
|
39
42
|
|
|
@@ -49,15 +52,16 @@ configurations { compile.exclude group: "junit", module: "junit" }
|
|
|
49
52
|
|
|
50
53
|
#### iOS Issue
|
|
51
54
|
|
|
52
|
-
> Undefined symbol: __swift_FORCE_LOAD_
|
|
55
|
+
> Undefined symbol: \__swift_FORCE_LOAD_$\_swiftUniformTypeIdentifiers
|
|
53
56
|
|
|
54
|
-
> Undefined symbol: __swift_FORCE_LOAD_
|
|
57
|
+
> Undefined symbol: \__swift_FORCE_LOAD_$\_swiftCoreMIDI
|
|
55
58
|
|
|
56
59
|
If you encouter the errors above, you may create a new swift file called **Void.swift** without adding **bridging header**.
|
|
57
60
|
|
|
58
61
|
<img src="images/image1.png">
|
|
59
62
|
|
|
60
63
|
## License
|
|
64
|
+
|
|
61
65
|
Apply licenses for Android and iOS SDKs
|
|
62
66
|
|
|
63
67
|
```
|
|
@@ -68,45 +72,47 @@ const license = Platform.select({
|
|
|
68
72
|
```
|
|
69
73
|
|
|
70
74
|
## OkayCam Document
|
|
75
|
+
|
|
71
76
|
### Configuration
|
|
72
77
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|frame|size|size of the frame (width and height)|90% of screen width and height is scaled proportionally according to card ratio|
|
|
80
|
-
|frame|color|color of the frame
|
|
81
|
-
|frame|content|content of the frame (able to display svg file within the frame for guidance|null|
|
|
82
|
-
|
|
83
|
-
|topLabel|text|text of the top label|""(empty string)|
|
|
84
|
-
|topLabel|color|color of the top label
|
|
85
|
-
|topLabel|size|text size of the top label|20|
|
|
86
|
-
|bottomLabel|text|text of the bottom label|""(empty string)|
|
|
87
|
-
|bottomLabel|color|color of the bottom label
|
|
88
|
-
|bottomLabel|size|text size of the bottom label|20|
|
|
89
|
-
|timer|backgroundColor|background of the count down timer
|
|
90
|
-
|timer|textColor|text color of the count down timer
|
|
91
|
-
|confirmBtnConfig|backgroundColor|background color of the confirm button
|
|
92
|
-
|confirmBtnConfig|contentColor|content color of the confirm button
|
|
93
|
-
|retakeBtnConfig|backgroundColor|background color of the retake button
|
|
94
|
-
|retakeBtnConfig|contentColor|content color of the retake button
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|preview
|
|
99
|
-
|preview
|
|
100
|
-
|preview
|
|
101
|
-
|preview|instruction2|instruction on preview screen|""(empty string)|
|
|
102
|
-
|preview
|
|
103
|
-
|preview
|
|
104
|
-
|instruction <sup>**New**</sup> |title|Instruction's title on camera caputre screen|""(empty string)|
|
|
105
|
-
|instruction <sup>**New**</sup> |refImage1|Instruction's reference image 1|null|
|
|
106
|
-
|instruction <sup>**New**</sup> |refImage2|Instruction's reference image 2|null|
|
|
107
|
-
|
|
78
|
+
| - | Property name | Description | Default value |
|
|
79
|
+
| ------------------------------ | ---------------------- | ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
|
|
80
|
+
| - | torchBtnEnabled | to show torch button. If set to true, it will only be shown if onFlash from captureConfig is set to false. | false |
|
|
81
|
+
| - | crop | crop the frame area | false |
|
|
82
|
+
| - | width | width to resize the image | original width |
|
|
83
|
+
| - | imageQuality | quality of image | 1.0 (range from 0.0 to 1.0) |
|
|
84
|
+
| frame | size | size of the frame (width and height) | 90% of screen width and height is scaled proportionally according to card ratio |
|
|
85
|
+
| frame | color | color of the frame | #ffffff |
|
|
86
|
+
| frame | content | content of the frame (able to display svg file within the frame for guidance | null |
|
|
87
|
+
| - | showOverlay | transparent black overlay | true |
|
|
88
|
+
| topLabel | text | text of the top label | ""(empty string) |
|
|
89
|
+
| topLabel | color | color of the top label | #ffffff |
|
|
90
|
+
| topLabel | size | text size of the top label | 20 |
|
|
91
|
+
| bottomLabel | text | text of the bottom label | ""(empty string) |
|
|
92
|
+
| bottomLabel | color | color of the bottom label | #ffffff |
|
|
93
|
+
| bottomLabel | size | text size of the bottom label | 20 |
|
|
94
|
+
| timer | backgroundColor | background of the count down timer | #ffa500 |
|
|
95
|
+
| timer | textColor | text color of the count down timer | #ffffff |
|
|
96
|
+
| confirmBtnConfig | backgroundColor | background color of the confirm button | #ffa500 |
|
|
97
|
+
| confirmBtnConfig | contentColor | content color of the confirm button | #ffffff |
|
|
98
|
+
| retakeBtnConfig | backgroundColor | background color of the retake button | #ffa500 |
|
|
99
|
+
| retakeBtnConfig | contentColor | content color of the retake button | #ffffff |
|
|
100
|
+
| - | captureBtnColor | color of the capture button | #ffffff |
|
|
101
|
+
| - | firstPhotoConfig | config for the first capture | delay:0s,onFlash:false,outputPath: null |
|
|
102
|
+
| - | secondPhotoConfig | config for the second capture | null |
|
|
103
|
+
| preview | title | title on preview screen | ""(empty string) |
|
|
104
|
+
| preview | refImg | ref image on preview screen | null |
|
|
105
|
+
| preview | instruction1 | instruction on preview screen | ""(empty string) |
|
|
106
|
+
| preview | instruction2 | instruction on preview screen | ""(empty string) |
|
|
107
|
+
| preview | instruction3 | instruction on preview screen | ""(empty string) |
|
|
108
|
+
| preview | backgroundColor | background color of preview screen | null |
|
|
109
|
+
| instruction <sup>**New**</sup> | title | Instruction's title on camera caputre screen | ""(empty string) |
|
|
110
|
+
| instruction <sup>**New**</sup> | refImage1 | Instruction's reference image 1 | null |
|
|
111
|
+
| instruction <sup>**New**</sup> | refImage2 | Instruction's reference image 2 | null |
|
|
112
|
+
| - | showPreviewInstruction | Show or hide preview instruction for captured photos | false |
|
|
108
113
|
|
|
109
114
|
## Usage
|
|
115
|
+
|
|
110
116
|
```
|
|
111
117
|
import { captureDocument } from "react-native-okaycam"
|
|
112
118
|
|
|
@@ -190,32 +196,35 @@ captureDocument(
|
|
|
190
196
|
```
|
|
191
197
|
|
|
192
198
|
### Result
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
|
196
|
-
|
|
|
199
|
+
|
|
200
|
+
| Result | Description |
|
|
201
|
+
| ------------------ | -------------------------------------------------------------------------------- |
|
|
202
|
+
| fullDocumentImage | Result of firstPhotoConfig |
|
|
203
|
+
| fullDocumentImage2 | Result of secondPhotoConfig. Will only return if secondPhotoConfig is configured |
|
|
197
204
|
|
|
198
205
|
## OkayCam Selfie
|
|
206
|
+
|
|
199
207
|
### Configuration
|
|
200
208
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|topLabel|text|text of the top label|Please align your face within the frame|
|
|
206
|
-
|topLabel|color|color of the top label
|
|
207
|
-
|topLabel|size|text size of the top label|24|
|
|
208
|
-
|
|
209
|
-
|switchBtnConfig|color|color of the switch button
|
|
210
|
-
|switchBtnConfig|show|show or hide the camera switch button|true|
|
|
211
|
-
|confirmBtnConfig|backgroundColor|background color of the confirm button
|
|
212
|
-
|confirmBtnConfig|contentColor|content color of the confirm button
|
|
213
|
-
|retakeBtnConfig|backgroundColor|background color of the retake button
|
|
214
|
-
|retakeBtnConfig|contentColor|content color of the retake button
|
|
215
|
-
|
|
216
|
-
|
|
209
|
+
| - | Property name | Description | Default value |
|
|
210
|
+
| ---------------- | ------------------- | ----------------------------------------------------- | --------------------------------------- |
|
|
211
|
+
| | width | width to resize the image | null |
|
|
212
|
+
| - | imageQuality | quality of image | 1.0 (range from 0.0 to 1.0) |
|
|
213
|
+
| topLabel | text | text of the top label | Please align your face within the frame |
|
|
214
|
+
| topLabel | color | color of the top label | #FFFFFF |
|
|
215
|
+
| topLabel | size | text size of the top label | 24 |
|
|
216
|
+
| - | bottomFrameColor | color of the bottom frame | #EB6709 |
|
|
217
|
+
| switchBtnConfig | color | color of the switch button | #FFFFFF |
|
|
218
|
+
| switchBtnConfig | show | show or hide the camera switch button | true |
|
|
219
|
+
| confirmBtnConfig | backgroundColor | background color of the confirm button | #ffa500 |
|
|
220
|
+
| confirmBtnConfig | contentColor | content color of the confirm button | #ffffff |
|
|
221
|
+
| retakeBtnConfig | backgroundColor | background color of the retake button | #ffa500 |
|
|
222
|
+
| retakeBtnConfig | contentColor | content color of the retake button | #ffffff |
|
|
223
|
+
| - | captureBtnColor | color of the capture button | #FFFFFF |
|
|
224
|
+
| - | defaultCameraFacing | initial camera facing when the selfie cam is launched | CameraFacing.FRONT |
|
|
217
225
|
|
|
218
226
|
## Usage
|
|
227
|
+
|
|
219
228
|
```
|
|
220
229
|
import { captureSelfie } from "react-native-okaycam"
|
|
221
230
|
|
|
@@ -255,14 +264,15 @@ captureSelfie(
|
|
|
255
264
|
```
|
|
256
265
|
|
|
257
266
|
### Result
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
|
267
|
+
|
|
268
|
+
| Result | Description |
|
|
269
|
+
| ----------- | --------------------- |
|
|
270
|
+
| selfieImage | Captured selfie image |
|
|
261
271
|
|
|
262
272
|
## Error Codes
|
|
263
273
|
|
|
264
|
-
| Error
|
|
265
|
-
|
|
|
266
|
-
| invalid license
|
|
267
|
-
| camera permission denied
|
|
268
|
-
| cancel
|
|
274
|
+
| Error | Description |
|
|
275
|
+
| ------------------------ | ------------------------------------------------------------------------ |
|
|
276
|
+
| invalid license | The license is invalid |
|
|
277
|
+
| camera permission denied | The use did not grant the permission to access camera in order to do OCR |
|
|
278
|
+
| cancel | The user canceled during the scanning process |
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#
|
|
1
|
+
#Thu Jun 20 12:59:35 BDT 2024
|
|
2
2
|
gradle.version=6.8
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build.gradle
CHANGED
|
@@ -39,7 +39,7 @@ repositories {
|
|
|
39
39
|
|
|
40
40
|
dependencies {
|
|
41
41
|
implementation 'com.facebook.react:react-native:+'
|
|
42
|
-
implementation('com.innov8tif.okaycam:OkayCam:1.2.
|
|
42
|
+
implementation('com.innov8tif.okaycam:OkayCam:1.2.8@aar') {
|
|
43
43
|
transitive = true
|
|
44
44
|
}
|
|
45
45
|
implementation 'com.googlecode.json-simple:json-simple:1.1.1'
|
package/package.json
CHANGED