Skip to content

Commit 5e44b0e

Browse files
authored
Merge pull request #44 from getyoti/release/DEP-461-4.0.0
[Task] DEP-461: RN 4.0.0
2 parents a2e118c + a9dce40 commit 5e44b0e

File tree

5 files changed

+33
-14
lines changed

5 files changed

+33
-14
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ To integrate with Yoti IDV, a working infrastructure is needed (see [developers.
1111

1212
## Requirements
1313
- [Android SDK 3+](https://github.com/getyoti/yoti-doc-scan-android/releases)
14-
- [iOS SDK 5+](https://github.com/getyoti/yoti-doc-scan-ios/releases)
14+
- [iOS SDK 6+](https://github.com/getyoti/yoti-doc-scan-ios/releases)
1515

1616
## Integration
1717
Start your integration by adding the following dependency to your `package.json` file:
1818
```json
1919
"dependencies": {
20-
"@getyoti/yoti-doc-scan-react-native": "^3.0.0"
20+
"@getyoti/yoti-doc-scan-react-native": "^4.0.0"
2121
}
2222
```
2323

@@ -108,9 +108,10 @@ RNYotiDocScan.startSession(id, token, successCallback, errorCallback);
108108
```
109109
110110
### 3. Customizations
111-
On iOS, you can set the primary color using the following API:
111+
On iOS, you can set the primary colors using the following API:
112112
```javascript
113-
RNYotiDocScan.setPrimaryColorRGB(0, 0, 0); // default: (40, 117, 188)
113+
RNYotiDocScan.setLightPrimaryColorRGB(0, 0, 0); // default: (40, 117, 188)
114+
RNYotiDocScan.setDarkPrimaryColorRGB(0, 0, 0); // default: (145, 190, 255)
114115
```
115116
To customize the colors on Android, please refer to its separate [documentation](https://github.com/getyoti/yoti-doc-scan-android#colours).
116117

android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ android {
1010
defaultConfig {
1111
minSdkVersion safeExtGet('minSdkVersion', 21)
1212
targetSdkVersion safeExtGet('targetSdkVersion', 33)
13-
versionCode 301
14-
versionName "3.0.1"
13+
versionCode 400
14+
versionName "4.0.0"
1515
ndk {
1616
abiFilters "armeabi-v7a", "x86"
1717
}

android/src/main/java/com/yoti/reactnative/docscan/RNYotiDocScanModule.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,12 @@ public void useCanadaService() {
5151
}
5252

5353
@ReactMethod
54-
public void setPrimaryColorRGB(double red, double green, double blue) {
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) {
5560
// Required to maintain cross-platform API compatibility.
5661
}
5762

ios/RNYotiDocScan.m

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ @interface RNYotiDocScan()
2323
@property (nonatomic, strong) NSString *sessionID;
2424
@property (nonatomic, strong) NSString *sessionToken;
2525
@property (nonatomic, assign) BOOL setUpCanadaServerLocation;
26-
@property (nonatomic, strong) UIColor *primaryColor;
26+
@property (nonatomic, strong) UIColor *lightPrimaryColor;
27+
@property (nonatomic, strong) UIColor *darkPrimaryColor;
2728
@property (nonatomic, strong) RCTResponseSenderBlock errorCallback;
2829
@property (nonatomic, strong) RCTResponseSenderBlock successCallback;
2930
@end
@@ -36,8 +37,12 @@ @implementation RNYotiDocScan
3637
_setUpCanadaServerLocation = YES;
3738
}
3839

39-
RCT_EXPORT_METHOD(setPrimaryColorRGB:(double)red green:(double)green blue:(double)blue) {
40-
_primaryColor = [UIColor colorWithRed:red/255.0 green:green/255.0 blue:blue/255.0 alpha:1.0];
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];
4146
}
4247

4348
RCT_EXPORT_METHOD(setRequestCode:(NSNumber * _Nonnull)requestCode) {
@@ -98,14 +103,22 @@ - (BOOL)isReactNativeClientFor:(YotiSDKNavigationController * _Nonnull)navigatio
98103
}
99104

100105
// MARK: - YotiSDKDelegate
101-
- (UIColor * _Nonnull)primaryColorFor:(YotiSDKNavigationController * _Nonnull)navigationController {
102-
if (_primaryColor != nil) {
103-
return _primaryColor;
106+
- (UIColor * _Nonnull)lightPrimaryColorFor:(YotiSDKNavigationController * _Nonnull)navigationController {
107+
if (_lightPrimaryColor != nil) {
108+
return _lightPrimaryColor;
104109
} else {
105110
return [UIColor colorWithRed:40.0/255.0 green:117.0/255.0 blue:188.0/255.0 alpha:1.0];
106111
}
107112
}
108113

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+
109122
- (void)navigationController:(YotiSDKNavigationController * _Nonnull)navigationController didFinishWithStatusCode:(NSInteger)statusCode {
110123
[_rootViewController dismissViewControllerAnimated:YES completion:nil];
111124
if (statusCode == kYotiSuccessStatusCode) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"license": "https://www.yoti.com/terms/identity-verification",
66
"author": "Yoti Ltd",
77
"main": "RNYotiDocScan.js",
8-
"version": "3.0.1",
8+
"version": "4.0.0",
99
"devDependencies": {
1010
"react": "^17.0.2",
1111
"react-dom": "^17.0.2",

0 commit comments

Comments
 (0)