react-native-okaycam 2.0.1 → 2.0.4
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 +86 -78
- package/android/.gradle/6.9/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/6.9/fileChanges/last-build.bin +0 -0
- package/android/.gradle/6.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/6.9/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- 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/.gradle/configuration-cache/gc.properties +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/build.gradle +1 -1
- package/ios/RNOkayCam.swift +5 -3
- 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
|
|
|
@@ -19,7 +21,7 @@
|
|
|
19
21
|
2. Add the following code to Podfile
|
|
20
22
|
|
|
21
23
|
```
|
|
22
|
-
platform :ios, '
|
|
24
|
+
platform :ios, '12.0'
|
|
23
25
|
use_frameworks!
|
|
24
26
|
|
|
25
27
|
post_install do |installer|
|
|
@@ -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
|
|
|
@@ -56,15 +59,16 @@ configurations { compile.exclude group: "junit", module: "junit" }
|
|
|
56
59
|
|
|
57
60
|
#### iOS Issue
|
|
58
61
|
|
|
59
|
-
> Undefined symbol: __swift_FORCE_LOAD_
|
|
62
|
+
> Undefined symbol: \__swift_FORCE_LOAD_$\_swiftUniformTypeIdentifiers
|
|
60
63
|
|
|
61
|
-
> Undefined symbol: __swift_FORCE_LOAD_
|
|
64
|
+
> Undefined symbol: \__swift_FORCE_LOAD_$\_swiftCoreMIDI
|
|
62
65
|
|
|
63
66
|
If you encouter the errors above, you may create a new swift file called **Void.swift** without adding **bridging header**.
|
|
64
67
|
|
|
65
68
|
<img src="images/image1.png">
|
|
66
69
|
|
|
67
70
|
## License
|
|
71
|
+
|
|
68
72
|
Apply licenses for Android and iOS SDKs
|
|
69
73
|
|
|
70
74
|
```
|
|
@@ -75,50 +79,50 @@ const license = Platform.select({
|
|
|
75
79
|
```
|
|
76
80
|
|
|
77
81
|
## OkayCam Document
|
|
78
|
-
### Configuration
|
|
79
|
-
|
|
80
|
-
-| Property name | Description |Default value
|
|
81
|
-
|--|--|--|--|
|
|
82
|
-
|-|torchBtnEnabled|to show torch button. If set to true, it will only be shown if onFlash from captureConfig is set to false.|false|
|
|
83
|
-
|-|crop|crop the frame area|false|
|
|
84
|
-
|-|width|width to resize the image|original width|
|
|
85
|
-
|-|imageQuality|quality of image|1.0 (range from 0.0 to 1.0)|
|
|
86
|
-
|frame|size|size of the frame (width and height)|90% of screen width and height is scaled proportionally according to card ratio|
|
|
87
|
-
|frame|color|color of the frame|#ffffff|
|
|
88
|
-
|frame|content|content of the frame (able to display svg file within the frame for guidance|null|
|
|
89
|
-
|-|showOverlay|transparent black overlay|true|
|
|
90
|
-
|topLabel|text|text of the top label|""(empty string)|
|
|
91
|
-
|topLabel|color|color of the top label|#ffffff|
|
|
92
|
-
|topLabel|size|text size of the top label|20|
|
|
93
|
-
|bottomLabel|text|text of the bottom label|""(empty string)|
|
|
94
|
-
|bottomLabel|color|color of the bottom label|#ffffff|
|
|
95
|
-
|bottomLabel|size|text size of the bottom label|20|
|
|
96
|
-
|timer|backgroundColor|background of the count down timer|#ffa500|
|
|
97
|
-
|timer|textColor|text color of the count down timer|#ffffff|
|
|
98
|
-
|confirmBtnConfig|backgroundColor|background color of the confirm button|#ffa500|
|
|
99
|
-
|confirmBtnConfig|contentColor|content color of the confirm button|#ffffff|
|
|
100
|
-
|retakeBtnConfig|backgroundColor|background color of the retake button|#ffa500|
|
|
101
|
-
|retakeBtnConfig|contentColor|content color of the retake button|#ffffff|
|
|
102
|
-
|captureConfig|first|config for the first capture|delay:0s,onFlash:false,outputPath: null|
|
|
103
|
-
|captureConfig|second|config for the second capture|delay:5s,onFlash:true,outputPath: null|
|
|
104
|
-
|<sup>**New**</sup>captureConfig|first|config for the first capture|delay:0s,onFlash:false,outputPath:null,onImageQuality:false|
|
|
105
|
-
|<sup>**New**</sup>captureConfig|second|config for the second capture|delay:5s,onFlash:true,outputPath:null,onImageQuality:false|
|
|
106
|
-
|-|captureBtnColor|color of the capture button|#ffffff|
|
|
107
|
-
|-|firstPhotoConfig|config for the first capture|delay:0s,onFlash:false,outputPath: null|
|
|
108
|
-
|-|secondPhotoConfig|config for the second capture|delay:5s,onFlash:false,outputPath: null|
|
|
109
|
-
|preview |title|title on preview screen|""(empty string)|
|
|
110
|
-
|preview |refImg|ref image on preview screen|null|
|
|
111
|
-
|preview |instruction1|instruction on preview screen|""(empty string)|
|
|
112
|
-
|preview|instruction2|instruction on preview screen|""(empty string)|
|
|
113
|
-
|preview |instruction3|instruction on preview screen|""(empty string)|
|
|
114
|
-
|preview |backgroundColor|background color of preview screen|null|
|
|
115
|
-
|instruction <sup>**New**</sup> |title|Instruction's title on camera caputre screen|""(empty string)|
|
|
116
|
-
|instruction <sup>**New**</sup> |refImage1|Instruction's reference image 1|null|
|
|
117
|
-
|instruction <sup>**New**</sup> |refImage2|Instruction's reference image 2|null|
|
|
118
82
|
|
|
83
|
+
### Configuration
|
|
119
84
|
|
|
85
|
+
| - | Property name | Description | Default value |
|
|
86
|
+
| ------------------------------- | ----------------- | ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
|
|
87
|
+
| - | torchBtnEnabled | to show torch button. If set to true, it will only be shown if onFlash from captureConfig is set to false. | false |
|
|
88
|
+
| - | crop | crop the frame area | false |
|
|
89
|
+
| - | width | width to resize the image | original width |
|
|
90
|
+
| - | imageQuality | quality of image | 1.0 (range from 0.0 to 1.0) |
|
|
91
|
+
| frame | size | size of the frame (width and height) | 90% of screen width and height is scaled proportionally according to card ratio |
|
|
92
|
+
| frame | color | color of the frame | #ffffff |
|
|
93
|
+
| frame | content | content of the frame (able to display svg file within the frame for guidance | null |
|
|
94
|
+
| - | showOverlay | transparent black overlay | true |
|
|
95
|
+
| topLabel | text | text of the top label | ""(empty string) |
|
|
96
|
+
| topLabel | color | color of the top label | #ffffff |
|
|
97
|
+
| topLabel | size | text size of the top label | 20 |
|
|
98
|
+
| bottomLabel | text | text of the bottom label | ""(empty string) |
|
|
99
|
+
| bottomLabel | color | color of the bottom label | #ffffff |
|
|
100
|
+
| bottomLabel | size | text size of the bottom label | 20 |
|
|
101
|
+
| timer | backgroundColor | background of the count down timer | #ffa500 |
|
|
102
|
+
| timer | textColor | text color of the count down timer | #ffffff |
|
|
103
|
+
| confirmBtnConfig | backgroundColor | background color of the confirm button | #ffa500 |
|
|
104
|
+
| confirmBtnConfig | contentColor | content color of the confirm button | #ffffff |
|
|
105
|
+
| retakeBtnConfig | backgroundColor | background color of the retake button | #ffa500 |
|
|
106
|
+
| retakeBtnConfig | contentColor | content color of the retake button | #ffffff |
|
|
107
|
+
| captureConfig | first | config for the first capture | delay:0s,onFlash:false,outputPath: null |
|
|
108
|
+
| captureConfig | second | config for the second capture | delay:5s,onFlash:true,outputPath: null |
|
|
109
|
+
| <sup>**New**</sup>captureConfig | first | config for the first capture | delay:0s,onFlash:false,outputPath:null,onImageQuality:false |
|
|
110
|
+
| <sup>**New**</sup>captureConfig | second | config for the second capture | delay:5s,onFlash:true,outputPath:null,onImageQuality:false |
|
|
111
|
+
| - | captureBtnColor | color of the capture button | #ffffff |
|
|
112
|
+
| - | firstPhotoConfig | config for the first capture | delay:0s,onFlash:false,outputPath: null |
|
|
113
|
+
| - | secondPhotoConfig | config for the second capture | delay:5s,onFlash:false,outputPath: null |
|
|
114
|
+
| preview | title | title on preview screen | ""(empty string) |
|
|
115
|
+
| preview | refImg | ref image on preview screen | null |
|
|
116
|
+
| preview | instruction1 | instruction on preview screen | ""(empty string) |
|
|
117
|
+
| preview | instruction2 | instruction on preview screen | ""(empty string) |
|
|
118
|
+
| preview | instruction3 | instruction on preview screen | ""(empty string) |
|
|
119
|
+
| preview | backgroundColor | background color of preview screen | null |
|
|
120
|
+
| instruction <sup>**New**</sup> | title | Instruction's title on camera caputre screen | ""(empty string) |
|
|
121
|
+
| instruction <sup>**New**</sup> | refImage1 | Instruction's reference image 1 | null |
|
|
122
|
+
| instruction <sup>**New**</sup> | refImage2 | Instruction's reference image 2 | null |
|
|
120
123
|
|
|
121
124
|
## Usage
|
|
125
|
+
|
|
122
126
|
```
|
|
123
127
|
import { captureDocument } from "react-native-okaycam"
|
|
124
128
|
|
|
@@ -201,38 +205,41 @@ captureDocument(
|
|
|
201
205
|
```
|
|
202
206
|
|
|
203
207
|
> **_NOTE:_** <br/>
|
|
204
|
-
Supported image format : JPG | PNG | SVG <br/>
|
|
205
|
-
Preffered size : less than 500KB
|
|
208
|
+
> Supported image format : JPG | PNG | SVG <br/>
|
|
209
|
+
> Preffered size : less than 500KB
|
|
206
210
|
|
|
207
211
|
### Result
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
|
211
|
-
|
|
|
212
|
-
|
|
|
213
|
-
|
|
|
212
|
+
|
|
213
|
+
| Result | Description |
|
|
214
|
+
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
215
|
+
| fullDocumentImage | Result of firstPhotoConfig |
|
|
216
|
+
| fullDocumentImage2 | Result of secondPhotoConfig. Will only return if secondPhotoConfig is configured. if secondPhotoConfig is not configured, it will be original image of fullDocumentImage |
|
|
217
|
+
| fullDocumentImage3 | Original Image if it exist |
|
|
218
|
+
| fullDocumentImage4 | Original Image if it exist |
|
|
214
219
|
|
|
215
220
|
## OkayCam Selfie
|
|
221
|
+
|
|
216
222
|
### Configuration
|
|
217
223
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|topLabel|text|text of the top label|Please align your face within the frame|
|
|
223
|
-
|topLabel|color|color of the top label
|
|
224
|
-
|topLabel|size|text size of the top label|24|
|
|
225
|
-
|
|
226
|
-
|switchBtnConfig|color|color of the switch button
|
|
227
|
-
|switchBtnConfig|show|show or hide the camera switch button|true|
|
|
228
|
-
|confirmBtnConfig|backgroundColor|background color of the confirm button
|
|
229
|
-
|confirmBtnConfig|contentColor|content color of the confirm button
|
|
230
|
-
|retakeBtnConfig|backgroundColor|background color of the retake button
|
|
231
|
-
|retakeBtnConfig|contentColor|content color of the retake button
|
|
232
|
-
|
|
233
|
-
|
|
224
|
+
| - | Property name | Description | Default value |
|
|
225
|
+
| ---------------- | ------------------- | ----------------------------------------------------- | --------------------------------------- |
|
|
226
|
+
| | width | width to resize the image | null |
|
|
227
|
+
| - | imageQuality | quality of image | 1.0 (range from 0.0 to 1.0) |
|
|
228
|
+
| topLabel | text | text of the top label | Please align your face within the frame |
|
|
229
|
+
| topLabel | color | color of the top label | #FFFFFF |
|
|
230
|
+
| topLabel | size | text size of the top label | 24 |
|
|
231
|
+
| - | bottomFrameColor | color of the bottom frame | #EB6709 |
|
|
232
|
+
| switchBtnConfig | color | color of the switch button | #FFFFFF |
|
|
233
|
+
| switchBtnConfig | show | show or hide the camera switch button | true |
|
|
234
|
+
| confirmBtnConfig | backgroundColor | background color of the confirm button | #ffa500 |
|
|
235
|
+
| confirmBtnConfig | contentColor | content color of the confirm button | #ffffff |
|
|
236
|
+
| retakeBtnConfig | backgroundColor | background color of the retake button | #ffa500 |
|
|
237
|
+
| retakeBtnConfig | contentColor | content color of the retake button | #ffffff |
|
|
238
|
+
| - | captureBtnColor | color of the capture button | #FFFFFF |
|
|
239
|
+
| - | defaultCameraFacing | initial camera facing when the selfie cam is launched | CameraFacing.FRONT |
|
|
234
240
|
|
|
235
241
|
## Usage
|
|
242
|
+
|
|
236
243
|
```
|
|
237
244
|
import { captureSelfie } from "react-native-okaycam"
|
|
238
245
|
|
|
@@ -272,14 +279,15 @@ captureSelfie(
|
|
|
272
279
|
```
|
|
273
280
|
|
|
274
281
|
### Result
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
|
282
|
+
|
|
283
|
+
| Result | Description |
|
|
284
|
+
| ----------- | --------------------- |
|
|
285
|
+
| selfieImage | Captured selfie image |
|
|
278
286
|
|
|
279
287
|
## Error Codes
|
|
280
288
|
|
|
281
|
-
| Error
|
|
282
|
-
|
|
|
283
|
-
| invalid license
|
|
284
|
-
| camera permission denied
|
|
285
|
-
| cancel
|
|
289
|
+
| Error | Description |
|
|
290
|
+
| ------------------------ | ------------------------------------------------------------------------ |
|
|
291
|
+
| invalid license | The license is invalid |
|
|
292
|
+
| camera permission denied | The use did not grant the permission to access camera in order to do OCR |
|
|
293
|
+
| cancel | The user canceled during the scanning process |
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
package/android/build.gradle
CHANGED
|
@@ -40,7 +40,7 @@ dependencies {
|
|
|
40
40
|
implementation('com.facebook.react:react-native:+'){
|
|
41
41
|
exclude module: 'fbjni-java-only'
|
|
42
42
|
}
|
|
43
|
-
implementation('com.innov8tif.okaycam:OkayCam:2.0.
|
|
43
|
+
implementation('com.innov8tif.okaycam:OkayCam:2.0.2@aar') {
|
|
44
44
|
transitive = true
|
|
45
45
|
}
|
|
46
46
|
implementation 'com.googlecode.json-simple:json-simple:1.1.1'
|
package/ios/RNOkayCam.swift
CHANGED
|
@@ -106,12 +106,14 @@ class RNOkayCam: NSObject {
|
|
|
106
106
|
okayCamConfig.captureConfigPair = CaptureConfigPair(
|
|
107
107
|
firstPhoto: OkayCamCaptureConfig(
|
|
108
108
|
timeOut: firstPhoto.object(forKey: "delay") as! Int,
|
|
109
|
-
onFlash: firstPhoto.object(forKey: "onFlash") as! Bool,
|
|
110
|
-
|
|
109
|
+
onFlash: firstPhoto.object(forKey: "onFlash") as! Bool,
|
|
110
|
+
onImageQuality: firstPhoto.object(forKey: "onImageQuality") as! Bool,
|
|
111
|
+
outputPath: (firstPhotoPath != nil) ? URL(string: (firstPhoto.object(forKey: "outputPath") as? String)!) : nil
|
|
111
112
|
),
|
|
112
113
|
secondPhoto: (secondPhoto != nil) ? OkayCamCaptureConfig(
|
|
113
114
|
timeOut: secondPhoto?.object(forKey: "delay") as? Int ?? 0,
|
|
114
|
-
onFlash: secondPhoto?.object(forKey: "onFlash") as? Bool ?? false,
|
|
115
|
+
onFlash: secondPhoto?.object(forKey: "onFlash") as? Bool ?? false,
|
|
116
|
+
onImageQuality: secondPhoto?.object(forKey: "onImageQuality") as! Bool,
|
|
115
117
|
outputPath: (secondPhotoPath != nil) ? URL(string: (secondPhoto?.object(forKey: "outputPath") as! String?)!) : nil
|
|
116
118
|
) : nil
|
|
117
119
|
)
|
package/package.json
CHANGED