Skip to content

Commit d3e21fb

Browse files
Fix/allow new enroll as bool (#91)
* fix: allow-new-enroll as bool * fix: add allow-new-enroll as bool to ios side * fix: add changelog * feat: bump versions * fix: bump podlock file * fix: make allow_new_enroll flag an optional parameter to reflect the android side * feat: allowneenroll on prepupload type --------- Co-authored-by: JNdhlovu <[email protected]>
1 parent c74fdf6 commit d3e21fb

File tree

8 files changed

+49
-38
lines changed

8 files changed

+49
-38
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Release Notes
22

3+
## 10.3.0
4+
* Changes the `allow_new_enroll` flag to be a real boolean instead of a string for prepUpload
5+
requests and multi-part requests. This is a breaking change for stored offline jobs, where the job
6+
is written using an older sdk version and then submission is attempted using this version.
7+
* Bump android to 10.6.0 (https://github.com/smileidentity/android/releases/tag/v10.6.0)
8+
* Bump iOS to 10.5.0 (https://github.com/smileidentity/ios/releases/tag/v10.5.0)
9+
310
## 10.2.6
411
* Added enhanced SmartSelfie™ capture Selfie capture screen component
512
* Added `skipApiSubmission` to SmartSelfie™ capture which defaults to `false` and will allow Selfie capture without submission to the api

android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ SmileId_minSdkVersion=21
33
SmileId_targetSdkVersion=35
44
SmileId_compileSdkVersion=35
55
SmileId_ndkversion=21.4.7075529
6-
SmileId_androidVersion=10.5.2
6+
SmileId_androidVersion=10.6.0
77
SmileId_kotlinCompilerExtensionVersion=1.5.11

android/src/main/java/com/smileidentity/react/Mapper.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ fun ReadableMap.toPrepUploadRequest(): PrepUploadRequest {
7979
timestamp = getStringOrDefault("timestamp") ?: run {
8080
throw IllegalArgumentException("timestamp is required")
8181
},
82-
//TODO: Remove this and use strings once the backend is updated
83-
allowNewEnroll = getBoolOrDefault("allowNewEnroll", false).toString(),
82+
allowNewEnroll = getBoolOrDefault("allowNewEnroll", false),
8483
signature = getStringOrDefault("signature") ?: run {
8584
throw IllegalArgumentException("signature is required")
8685
},

example/ios/Podfile.lock

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ PODS:
1212
- hermes-engine (0.74.2):
1313
- hermes-engine/Pre-built (= 0.74.2)
1414
- hermes-engine/Pre-built (0.74.2)
15-
- lottie-ios (4.4.3)
15+
- lottie-ios (4.5.1)
1616
- RCT-Folly (2024.01.01.00):
1717
- boost
1818
- DoubleConversion
@@ -941,9 +941,9 @@ PODS:
941941
- React-Mapbuffer (0.74.2):
942942
- glog
943943
- React-debug
944-
- react-native-safe-area-context (4.14.0):
944+
- react-native-safe-area-context (4.14.1):
945945
- React-Core
946-
- react-native-smile-id (10.2.6):
946+
- react-native-smile-id (10.3.0):
947947
- DoubleConversion
948948
- glog
949949
- hermes-engine
@@ -963,7 +963,7 @@ PODS:
963963
- React-utils
964964
- ReactCommon/turbomodule/bridging
965965
- ReactCommon/turbomodule/core
966-
- SmileID (= 10.4.2)
966+
- SmileID (= 10.5.0)
967967
- Yoga
968968
- React-nativeconfig (0.74.2)
969969
- React-NativeModulesApple (0.74.2):
@@ -1216,9 +1216,9 @@ PODS:
12161216
- ReactCommon/turbomodule/bridging
12171217
- ReactCommon/turbomodule/core
12181218
- Yoga
1219-
- SmileID (10.4.2):
1219+
- SmileID (10.5.0):
12201220
- FingerprintJS
1221-
- lottie-ios (~> 4.4.2)
1221+
- lottie-ios (~> 4.5.0)
12221222
- ZIPFoundation (~> 0.9)
12231223
- SocketRocket (0.7.0)
12241224
- Yoga (0.0.0)
@@ -1418,7 +1418,7 @@ SPEC CHECKSUMS:
14181418
fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120
14191419
glog: fdfdfe5479092de0c4bdbebedd9056951f092c4f
14201420
hermes-engine: 01d3e052018c2a13937aca1860fbedbccd4a41b7
1421-
lottie-ios: fcb5e73e17ba4c983140b7d21095c834b3087418
1421+
lottie-ios: 248b380fa1b97d18e792c37d90da7ab2aa0d6562
14221422
RCT-Folly: 02617c592a293bd6d418e0a88ff4ee1f88329b47
14231423
RCTDeprecation: b03c35057846b685b3ccadc9bfe43e349989cdb2
14241424
RCTRequired: 194626909cfa8d39ca6663138c417bc6c431648c
@@ -1443,8 +1443,8 @@ SPEC CHECKSUMS:
14431443
React-jsitracing: 0fa7f78d8fdda794667cb2e6f19c874c1cf31d7e
14441444
React-logger: 29fa3e048f5f67fe396bc08af7606426d9bd7b5d
14451445
React-Mapbuffer: bf56147c9775491e53122a94c423ac201417e326
1446-
react-native-safe-area-context: 4532f1a0c5d34a46b9324ccaaedcb5582a302b7d
1447-
react-native-smile-id: 4074e214a9d1e5e06d6f0f0d1f2e17f70f8ac60f
1446+
react-native-safe-area-context: 141eca0fd4e4191288dfc8b96a7c7e1c2983447a
1447+
react-native-smile-id: c127c9830f349b3ceac88f1dbdc5243554cea051
14481448
React-nativeconfig: 9f223cd321823afdecf59ed00861ab2d69ee0fc1
14491449
React-NativeModulesApple: ff7efaff7098639db5631236cfd91d60abff04c0
14501450
React-perflogger: 32ed45d9cee02cf6639acae34251590dccd30994
@@ -1469,7 +1469,7 @@ SPEC CHECKSUMS:
14691469
React-utils: 4476b7fcbbd95cfd002f3e778616155241d86e31
14701470
ReactCommon: ecad995f26e0d1e24061f60f4e5d74782f003f12
14711471
RNScreens: 48bc9eba07f93971071a5268b4fe5fcb784a5ef8
1472-
SmileID: d65cea02b08bc293ba6324b617d7a08ab2d0348f
1472+
SmileID: eab70b212dcc89e5614035e1746016db172c8f50
14731473
SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d
14741474
Yoga: ae3c32c514802d30f687a04a6a35b348506d411f
14751475
ZIPFoundation: b8c29ea7ae353b309bc810586181fd073cb3312c

ios/Utils/SmileIDDictExt.swift

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ extension NSDictionary {
1010
testLambdaUrl: (self["testLambdaUrl"] as? String)!
1111
)
1212
}
13-
13+
1414
func toAuthenticationRequest() -> AuthenticationRequest? {
1515
guard let jobTypeValue = self["jobType"] as? Int,
1616
let jobType = JobType(rawValue: jobTypeValue),
@@ -19,11 +19,11 @@ extension NSDictionary {
1919
else {
2020
return nil
2121
}
22-
22+
2323
let country = self["country"] as? String
2424
let idType = self["idType"] as? String
2525
let updateEnrolledImage = self["updateEnrolledImage"] as? Bool
26-
26+
2727
return AuthenticationRequest(
2828
jobType: jobType,
2929
updateEnrolledImage: updateEnrolledImage,
@@ -33,7 +33,7 @@ extension NSDictionary {
3333
idType: idType
3434
)
3535
}
36-
36+
3737
func toPrepUploadRequest() -> PrepUploadRequest? {
3838
guard let partnerParamsDict = self["partnerParams"] as? NSDictionary,
3939
let partnerParams = partnerParamsDict.toPartnerParams(),
@@ -44,49 +44,51 @@ extension NSDictionary {
4444
else {
4545
return nil
4646
}
47-
47+
let allowNewEnroll = self["allowNewEnroll"] as? Bool ?? false
48+
4849
return PrepUploadRequest(
4950
partnerParams: partnerParams,
5051
callbackUrl: callbackUrl,
52+
allowNewEnroll: allowNewEnroll,
5153
partnerId: partnerId,
5254
sourceSdk: self["sourceSdk"] as? String ?? "ios (react-native)",
5355
timestamp: timestamp,
5456
signature: signature
5557
)
5658
}
57-
59+
5860
func toUploadRequest() -> UploadRequest? {
5961
guard let imagesArray = self["images"] as? [NSDictionary] else {
6062
return nil
6163
}
6264
let images = imagesArray.compactMap { $0.toUploadImageInfo() }
6365
let idInfo = (self["idInfo"] as? NSDictionary)?.toIdInfo()
64-
66+
6567
return UploadRequest(
6668
images: images,
6769
idInfo: idInfo
6870
)
6971
}
70-
72+
7173
func toUploadImageInfo() -> UploadImageInfo? {
7274
guard let imageTypeIdValue = self["imageTypeId"] as? String,
7375
let imageTypeId = ImageType(rawValue: imageTypeIdValue),
7476
let imageName = self["imageName"] as? String
7577
else {
7678
return nil
7779
}
78-
80+
7981
return UploadImageInfo(
8082
imageTypeId: imageTypeId,
8183
fileName: imageName
8284
)
8385
}
84-
86+
8587
func toIdInfo() -> IdInfo? {
8688
guard let country = self["country"] as? String else {
8789
return nil
8890
}
89-
91+
9092
let idType = self["idType"] as? String
9193
let idNumber = self["idNumber"] as? String
9294
let firstName = self["firstName"] as? String
@@ -95,7 +97,7 @@ extension NSDictionary {
9597
let dob = self["dob"] as? String
9698
let bankCode = self["bankCode"] as? String
9799
let entered = self["entered"] as? Bool
98-
100+
99101
return IdInfo(
100102
country: country,
101103
idType: idType,
@@ -108,7 +110,7 @@ extension NSDictionary {
108110
entered: entered
109111
)
110112
}
111-
113+
112114
func toConsentInfo() -> ConsentInformation {
113115
let consentGrantedDate = self["consentGrantedDate"] as? String ?? getCurrentIsoTimestamp()
114116
let personalDetailsConsentGranted = self["personalDetailsConsentGranted"] as? Bool ?? false
@@ -121,7 +123,7 @@ extension NSDictionary {
121123
documentInformationConsentGranted: documentInfoConsentGranted
122124
)
123125
}
124-
126+
125127
func toEnhancedKycRequest() -> EnhancedKycRequest? {
126128
guard let country = self["country"] as? String,
127129
let idType = self["idType"] as? String,
@@ -140,7 +142,7 @@ extension NSDictionary {
140142
else {
141143
return nil
142144
}
143-
145+
144146
let consentInfo: ConsentInformation
145147
if let consentInformation = self["consentInformation"] as? NSDictionary{
146148
consentInfo = consentInformation.toConsentInfo()
@@ -152,7 +154,7 @@ extension NSDictionary {
152154
documentInformationConsentGranted: false
153155
)
154156
}
155-
157+
156158
return EnhancedKycRequest(
157159
country: country,
158160
idType: idType,
@@ -171,7 +173,7 @@ extension NSDictionary {
171173
signature: signature
172174
)
173175
}
174-
176+
175177
func toJobStatusRequest() -> JobStatusRequest? {
176178
guard let userId = self["userId"] as? String,
177179
let jobId = self["jobId"] as? String,
@@ -183,7 +185,7 @@ extension NSDictionary {
183185
else {
184186
return nil
185187
}
186-
188+
187189
return JobStatusRequest(
188190
userId: userId,
189191
jobId: jobId,
@@ -194,22 +196,22 @@ extension NSDictionary {
194196
signature: signature
195197
)
196198
}
197-
199+
198200
func toProductsConfigRequest() -> ProductsConfigRequest? {
199201
guard let partnerId = self["partnerId"] as? String,
200202
let timestamp = self["timestamp"] as? String,
201203
let signature = self["signature"] as? String
202204
else {
203205
return nil
204206
}
205-
207+
206208
return ProductsConfigRequest(
207209
timestamp: timestamp,
208210
signature: signature,
209211
partnerId: partnerId
210212
)
211213
}
212-
214+
213215
func toPartnerParams() -> PartnerParams? {
214216
guard let country = self["country"] as? String else {
215217
return nil
@@ -242,7 +244,7 @@ extension Dictionary where Key == String, Value == Any {
242244
}
243245
return jsonCompatibleDict
244246
}
245-
247+
246248
private func convertToJSONCompatible(_ value: Any) -> Any {
247249
switch value {
248250
case let url as URL:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@smile_identity/react-native",
3-
"version": "10.2.6",
3+
"version": "10.3.0",
44
"description": "Official wrapper for the Smile ID <v10 android and iOS SDKs",
55
"main": "lib/commonjs/index",
66
"module": "lib/module/index",

react-native-smile-id.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Pod::Spec.new do |s|
1515
s.source = { :git => "https://docs.usesmileid.com/.git", :tag => "#{s.version}" }
1616

1717
s.source_files = "ios/**/*.{h,m,mm,swift}"
18-
s.dependency "SmileID", "10.4.2"
18+
s.dependency "SmileID", "10.5.0"
1919

2020
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
2121
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.

src/types.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,19 +303,22 @@ export class PrepUploadRequest {
303303
partnerId: string;
304304
timestamp: string;
305305
signature: string;
306+
allowNewEnroll?: boolean;
306307

307308
constructor(
308309
partnerParams: PartnerParams,
309310
partnerId: string,
310311
timestamp: string,
311312
signature: string,
312-
callbackUrl?: string
313+
callbackUrl?: string,
314+
allowNewEnroll?: boolean
313315
) {
314316
this.partnerParams = partnerParams;
315317
this.partnerId = partnerId;
316318
this.timestamp = timestamp;
317319
this.signature = signature;
318320
this.callbackUrl = callbackUrl;
321+
this.allowNewEnroll = allowNewEnroll;
319322
}
320323
}
321324

0 commit comments

Comments
 (0)