@getyoti/yoti-doc-scan-react-native 3.0.1 → 4.0.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/README.md
CHANGED
|
@@ -11,13 +11,13 @@ To integrate with Yoti IDV, a working infrastructure is needed (see [developers.
|
|
|
11
11
|
|
|
12
12
|
## Requirements
|
|
13
13
|
- [Android SDK 3+](https://github.com/getyoti/yoti-doc-scan-android/releases)
|
|
14
|
-
- [iOS SDK
|
|
14
|
+
- [iOS SDK 6+](https://github.com/getyoti/yoti-doc-scan-ios/releases)
|
|
15
15
|
|
|
16
16
|
## Integration
|
|
17
17
|
Start your integration by adding the following dependency to your `package.json` file:
|
|
18
18
|
```json
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@getyoti/yoti-doc-scan-react-native": "^
|
|
20
|
+
"@getyoti/yoti-doc-scan-react-native": "^4.0.0"
|
|
21
21
|
}
|
|
22
22
|
```
|
|
23
23
|
|
|
@@ -26,7 +26,7 @@ Continuing with your integration for Android, add the following property and rep
|
|
|
26
26
|
```groovy
|
|
27
27
|
buildscript {
|
|
28
28
|
ext {
|
|
29
|
-
yotiSdkVersion = "3.
|
|
29
|
+
yotiSdkVersion = "3.5.0"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
allprojects {
|
|
@@ -108,9 +108,10 @@ RNYotiDocScan.startSession(id, token, successCallback, errorCallback);
|
|
|
108
108
|
```
|
|
109
109
|
|
|
110
110
|
### 3. Customizations
|
|
111
|
-
On iOS, you can set the primary
|
|
111
|
+
On iOS, you can set the primary colors using the following API:
|
|
112
112
|
```javascript
|
|
113
|
-
RNYotiDocScan.
|
|
113
|
+
RNYotiDocScan.setLightPrimaryColorRGB(0, 0, 0); // default: (40, 117, 188)
|
|
114
|
+
RNYotiDocScan.setDarkPrimaryColorRGB(0, 0, 0); // default: (145, 190, 255)
|
|
114
115
|
```
|
|
115
116
|
To customize the colors on Android, please refer to its separate [documentation](https://github.com/getyoti/yoti-doc-scan-android#colours).
|
|
116
117
|
|
package/android/build.gradle
CHANGED
|
@@ -10,8 +10,8 @@ android {
|
|
|
10
10
|
defaultConfig {
|
|
11
11
|
minSdkVersion safeExtGet('minSdkVersion', 21)
|
|
12
12
|
targetSdkVersion safeExtGet('targetSdkVersion', 33)
|
|
13
|
-
versionCode
|
|
14
|
-
versionName "
|
|
13
|
+
versionCode 400
|
|
14
|
+
versionName "4.0.0"
|
|
15
15
|
ndk {
|
|
16
16
|
abiFilters "armeabi-v7a", "x86"
|
|
17
17
|
}
|
|
@@ -51,7 +51,12 @@ public class RNYotiDocScanModule extends ReactContextBaseJavaModule {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
@ReactMethod
|
|
54
|
-
public void
|
|
54
|
+
public void setLightPrimaryColorRGB(double red, double green, double blue) {
|
|
55
|
+
// Required to maintain cross-platform API compatibility.
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@ReactMethod
|
|
59
|
+
public void setDarkPrimaryColorRGB(double red, double green, double blue) {
|
|
55
60
|
// Required to maintain cross-platform API compatibility.
|
|
56
61
|
}
|
|
57
62
|
|
package/ios/RNYotiDocScan.m
CHANGED
|
@@ -23,7 +23,8 @@ NSInteger const kYotiSuccessStatusCode = 0;
|
|
|
23
23
|
@property (nonatomic, strong) NSString *sessionID;
|
|
24
24
|
@property (nonatomic, strong) NSString *sessionToken;
|
|
25
25
|
@property (nonatomic, assign) BOOL setUpCanadaServerLocation;
|
|
26
|
-
@property (nonatomic, strong) UIColor *
|
|
26
|
+
@property (nonatomic, strong) UIColor *lightPrimaryColor;
|
|
27
|
+
@property (nonatomic, strong) UIColor *darkPrimaryColor;
|
|
27
28
|
@property (nonatomic, strong) RCTResponseSenderBlock errorCallback;
|
|
28
29
|
@property (nonatomic, strong) RCTResponseSenderBlock successCallback;
|
|
29
30
|
@end
|
|
@@ -36,8 +37,12 @@ RCT_EXPORT_METHOD(useCanadaService) {
|
|
|
36
37
|
_setUpCanadaServerLocation = YES;
|
|
37
38
|
}
|
|
38
39
|
|
|
39
|
-
RCT_EXPORT_METHOD(
|
|
40
|
-
|
|
40
|
+
RCT_EXPORT_METHOD(setLightPrimaryColorRGB:(double)red green:(double)green blue:(double)blue) {
|
|
41
|
+
_lightPrimaryColor = [UIColor colorWithRed:red/255.0 green:green/255.0 blue:blue/255.0 alpha:1.0];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
RCT_EXPORT_METHOD(setDarkPrimaryColorRGB:(double)red green:(double)green blue:(double)blue) {
|
|
45
|
+
_darkPrimaryColor = [UIColor colorWithRed:red/255.0 green:green/255.0 blue:blue/255.0 alpha:1.0];
|
|
41
46
|
}
|
|
42
47
|
|
|
43
48
|
RCT_EXPORT_METHOD(setRequestCode:(NSNumber * _Nonnull)requestCode) {
|
|
@@ -98,14 +103,22 @@ RCT_EXPORT_METHOD(startSession:(NSString *)sessionId clientSessionToken:(NSStrin
|
|
|
98
103
|
}
|
|
99
104
|
|
|
100
105
|
// MARK: - YotiSDKDelegate
|
|
101
|
-
- (UIColor * _Nonnull)
|
|
102
|
-
if (
|
|
103
|
-
return
|
|
106
|
+
- (UIColor * _Nonnull)lightPrimaryColorFor:(YotiSDKNavigationController * _Nonnull)navigationController {
|
|
107
|
+
if (_lightPrimaryColor != nil) {
|
|
108
|
+
return _lightPrimaryColor;
|
|
104
109
|
} else {
|
|
105
110
|
return [UIColor colorWithRed:40.0/255.0 green:117.0/255.0 blue:188.0/255.0 alpha:1.0];
|
|
106
111
|
}
|
|
107
112
|
}
|
|
108
113
|
|
|
114
|
+
- (UIColor * _Nonnull)darkPrimaryColorFor:(YotiSDKNavigationController * _Nonnull)navigationController {
|
|
115
|
+
if (_darkPrimaryColor != nil) {
|
|
116
|
+
return _darkPrimaryColor;
|
|
117
|
+
} else {
|
|
118
|
+
return [UIColor colorWithRed:145.0/255.0 green:190.0/255.0 blue:255.0/255.0 alpha:1.0];
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
109
122
|
- (void)navigationController:(YotiSDKNavigationController * _Nonnull)navigationController didFinishWithStatusCode:(NSInteger)statusCode {
|
|
110
123
|
[_rootViewController dismissViewControllerAnimated:YES completion:nil];
|
|
111
124
|
if (statusCode == kYotiSuccessStatusCode) {
|