@veriff/react-native-sdk 13.1.0 → 14.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.
@@ -9,8 +9,8 @@ buildscript {
9
9
  }
10
10
 
11
11
  dependencies {
12
- classpath 'com.android.tools.build:gradle:7.4.2'
13
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet('kotlinVersion', '2.0.21')}"
12
+ classpath 'com.android.tools.build:gradle:8.12.0'
13
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet('kotlinVersion', '2.1.20')}"
14
14
  }
15
15
  }
16
16
 
@@ -31,12 +31,12 @@ android {
31
31
  }
32
32
  }
33
33
 
34
- compileSdkVersion safeExtGet('compileSdkVersion', 35)
35
- buildToolsVersion safeExtGet('buildToolsVersion', '35.0.0')
34
+ compileSdkVersion safeExtGet('compileSdkVersion', 36)
35
+ buildToolsVersion safeExtGet('buildToolsVersion', '36.0.0')
36
36
 
37
37
  defaultConfig {
38
38
  minSdkVersion safeExtGet('minSdkVersion', 26)
39
- targetSdkVersion safeExtGet('targetSdkVersion', 35)
39
+ targetSdkVersion safeExtGet('targetSdkVersion', 36)
40
40
  }
41
41
  }
42
42
 
@@ -50,7 +50,7 @@ repositories {
50
50
  dependencies {
51
51
  //noinspection GradleDynamicVersion
52
52
  implementation 'com.facebook.react:react-android:+'
53
- implementation "org.jetbrains.kotlin:kotlin-stdlib:1.8.21"
53
+ implementation "org.jetbrains.kotlin:kotlin-stdlib:2.1.20"
54
54
 
55
- implementation 'com.veriff:veriff-library:9.0.1'
55
+ implementation 'com.veriff:veriff-library:14.0.0'
56
56
  }
@@ -145,6 +145,11 @@ class VeriffSdkModule(private val reactContext: ReactApplicationContext) :
145
145
  parseColor(brandConfig.getString(KEY_ON_BACKGROUND_TERTIARY))
146
146
  )
147
147
  }
148
+ if (brandConfig.hasKey(KEY_ON_BACKGROUND_ERROR)) {
149
+ branding.onBackgroundError(
150
+ parseColor(brandConfig.getString(KEY_ON_BACKGROUND_ERROR))
151
+ )
152
+ }
148
153
  if (brandConfig.hasKey(KEY_PRIMARY)) {
149
154
  branding.primary(parseColor(brandConfig.getString(KEY_PRIMARY)))
150
155
  }
@@ -157,6 +162,14 @@ class VeriffSdkModule(private val reactContext: ReactApplicationContext) :
157
162
  if (brandConfig.hasKey(KEY_ON_SECONDARY)) {
158
163
  branding.onSecondary(parseColor(brandConfig.getString(KEY_ON_SECONDARY)))
159
164
  }
165
+ if (brandConfig.hasKey(KEY_ILLUSTRATION)) {
166
+ branding.illustration(parseColor(brandConfig.getString(KEY_ILLUSTRATION)))
167
+ }
168
+ if (brandConfig.hasKey(KEY_ILLUSTRATION_SECONDARY)) {
169
+ branding.illustrationSecondary(
170
+ parseColor(brandConfig.getString(KEY_ILLUSTRATION_SECONDARY))
171
+ )
172
+ }
160
173
  if (brandConfig.hasKey(KEY_CAMERA_OVERLAY)) {
161
174
  branding.cameraOverlay(parseColor(brandConfig.getString(KEY_CAMERA_OVERLAY)))
162
175
  }
@@ -168,12 +181,6 @@ class VeriffSdkModule(private val reactContext: ReactApplicationContext) :
168
181
  if (brandConfig.hasKey(KEY_OUTLINE)) {
169
182
  branding.outline(parseColor(brandConfig.getString(KEY_OUTLINE)))
170
183
  }
171
- if (brandConfig.hasKey(KEY_SUCCESS)) {
172
- branding.success(parseColor(brandConfig.getString(KEY_SUCCESS)))
173
- }
174
- if (brandConfig.hasKey(KEY_ERROR)) {
175
- branding.error(parseColor(brandConfig.getString(KEY_ERROR)))
176
- }
177
184
  if (brandConfig.hasKey(KEY_FEEDBACK_SUCCESS)) {
178
185
  branding.feedbackSuccess(
179
186
  parseColor(brandConfig.getString(KEY_FEEDBACK_SUCCESS))
@@ -197,6 +204,18 @@ class VeriffSdkModule(private val reactContext: ReactApplicationContext) :
197
204
  if (brandConfig.hasKey(KEY_BUTTON_RADIUS)) {
198
205
  branding.buttonRadius(brandConfig.getDouble(KEY_BUTTON_RADIUS).toFloat())
199
206
  }
207
+ if (brandConfig.hasKey(KEY_TEXT_ALIGNMENT)) {
208
+ when (brandConfig.getString(KEY_TEXT_ALIGNMENT)) {
209
+ "leading" -> branding.textAlignment(Branding.TextAlignment.Leading)
210
+ "center" -> branding.textAlignment(Branding.TextAlignment.Center)
211
+ }
212
+ }
213
+ if (brandConfig.hasKey(KEY_CLOSE_BUTTON_POSITION)) {
214
+ when (brandConfig.getString(KEY_CLOSE_BUTTON_POSITION)) {
215
+ "leading" -> branding.closeButtonPosition(Branding.CloseButtonPosition.Leading)
216
+ "trailing" -> branding.closeButtonPosition(Branding.CloseButtonPosition.Trailing)
217
+ }
218
+ }
200
219
  if (brandConfig.hasKey(KEY_FONT)) {
201
220
  brandConfig.getMap(KEY_FONT)?.let { srcFont ->
202
221
  val font = buildFont(activity, srcFont)
@@ -386,20 +405,23 @@ class VeriffSdkModule(private val reactContext: ReactApplicationContext) :
386
405
  private const val KEY_ON_BACKGROUND = "onBackground"
387
406
  private const val KEY_ON_BACKGROUND_SECONDARY = "onBackgroundSecondary"
388
407
  private const val KEY_ON_BACKGROUND_TERTIARY = "onBackgroundTertiary"
408
+ private const val KEY_ON_BACKGROUND_ERROR = "onBackgroundError"
389
409
  private const val KEY_PRIMARY = "primary"
390
410
  private const val KEY_ON_PRIMARY = "onPrimary"
391
411
  private const val KEY_SECONDARY = "secondary"
392
412
  private const val KEY_ON_SECONDARY = "onSecondary"
413
+ private const val KEY_ILLUSTRATION = "illustration"
414
+ private const val KEY_ILLUSTRATION_SECONDARY = "illustrationSecondary"
393
415
  private const val KEY_CAMERA_OVERLAY = "cameraOverlay"
394
416
  private const val KEY_ON_CAMERA_OVERLAY = "onCameraOverlay"
395
417
  private const val KEY_OUTLINE = "outline"
396
- private const val KEY_SUCCESS = "success"
397
- private const val KEY_ERROR = "error"
398
418
  private const val KEY_FEEDBACK_SUCCESS = "feedbackSuccess"
399
419
  private const val KEY_ON_FEEDBACK_SUCCESS = "onFeedbackSuccess"
400
420
  private const val KEY_FEEDBACK_ERROR = "feedbackError"
401
421
  private const val KEY_ON_FEEDBACK_ERROR = "onFeedbackError"
402
422
  const val KEY_BUTTON_RADIUS = "buttonRadius"
423
+ private const val KEY_TEXT_ALIGNMENT = "textAlignment"
424
+ private const val KEY_CLOSE_BUTTON_POSITION = "closeButtonPosition"
403
425
  private const val KEY_CUSTOM_INTRO_SCREEN = "customIntroScreen"
404
426
  private const val KEY_RN_IMAGE_URI = "uri"
405
427
  private const val KEY_RN_VENDOR_DATA = "vendorData"
package/ios/Podfile CHANGED
@@ -9,7 +9,7 @@ require Pod::Executable.execute_command('node', ['-p',
9
9
 
10
10
  target 'VeriffSdk' do
11
11
  # Pods for VeriffSdk
12
- pod 'VeriffSDK', '10.2.0'
12
+ pod 'VeriffSDK', '14.0.0'
13
13
  # Add it to your Podfile if you want to enable NFC scanning
14
14
  pod 'VeriffNFCSDK'
15
15
 
@@ -19,6 +19,7 @@ class VeriffSdk: NSObject {
19
19
  private static let ERROR_SESSION = "SESSION_ERROR"
20
20
  private static let ERROR_UNSUPPORTED_SDK_VERSION = "UNSUPPORTED_SDK_VERSION"
21
21
  private static let ERROR_UNKNOWN = "UNKNOWN_ERROR"
22
+ private static let ERROR_DEVICE_HAS_NO_NFC = "DEVICE_HAS_NO_NFC"
22
23
 
23
24
  private static let DEFAULT_BASE_URL = "https://magic.veriff.me"
24
25
  private static let SESSION_TOKEN = "sessionToken"
@@ -28,7 +29,6 @@ class VeriffSdk: NSObject {
28
29
  private static let BRANDING = "branding"
29
30
  private static let LOCALE = "locale"
30
31
  private static let LOGO = "logo"
31
- private static let USE_CUSTOM_INTRO_SCREEN = "customIntroScreen"
32
32
  private static let VENDOR_DATA = "vendorData"
33
33
 
34
34
  private static let STATUS = "status"
@@ -91,20 +91,31 @@ class VeriffSdk: NSObject {
91
91
  branding.onBackground = brandingConfig.color(for: "onBackground")
92
92
  branding.onBackgroundSecondary = brandingConfig.color(for: "onBackgroundSecondary")
93
93
  branding.onBackgroundTertiary = brandingConfig.color(for: "onBackgroundTertiary")
94
+ branding.onBackgroundError = brandingConfig.color(for: "onBackgroundError")
94
95
  branding.primary = brandingConfig.color(for: "primary")
95
96
  branding.onPrimary = brandingConfig.color(for: "onPrimary")
96
97
  branding.secondary = brandingConfig.color(for: "secondary")
97
98
  branding.onSecondary = brandingConfig.color(for: "onSecondary")
99
+ branding.illustration = brandingConfig.color(for: "illustration")
100
+ branding.illustrationSecondary = brandingConfig.color(for: "illustrationSecondary")
98
101
  branding.cameraOverlay = brandingConfig.color(for: "cameraOverlay")
99
102
  branding.onCameraOverlay = brandingConfig.color(for: "onCameraOverlay")
100
103
  branding.outline = brandingConfig.color(for: "outline")
101
- branding.error = brandingConfig.color(for: "error")
102
- branding.success = brandingConfig.color(for: "success")
103
- branding.feedbackSuccessBackground = brandingConfig.color(for: "feedbackSuccess")
104
+ branding.feedbackSuccess = brandingConfig.color(for: "feedbackSuccess")
104
105
  branding.onFeedbackSuccess = brandingConfig.color(for: "onFeedbackSuccess")
105
- branding.feedbackErrorBackground = brandingConfig.color(for: "feedbackError")
106
+ branding.feedbackError = brandingConfig.color(for: "feedbackError")
106
107
  branding.onFeedbackError = brandingConfig.color(for: "onFeedbackError")
107
108
  branding.buttonRadius = (brandingConfig["buttonRadius"] as? Double).map { CGFloat($0) }
109
+ switch brandingConfig["textAlignment"] as? String {
110
+ case "leading": branding.textAlignment = .leading
111
+ case "center": branding.textAlignment = .center
112
+ default: break
113
+ }
114
+ switch brandingConfig["closeButtonPosition"] as? String {
115
+ case "leading": branding.closeButtonPosition = .leading
116
+ case "trailing": branding.closeButtonPosition = .trailing
117
+ default: break
118
+ }
108
119
  if
109
120
  let font = brandingConfig["iOSFont"] as? [String: Any],
110
121
  let regular = font["regular"] as? String,
@@ -145,7 +156,6 @@ class VeriffSdk: NSObject {
145
156
  return
146
157
  }
147
158
 
148
- veriffConfiguration?.customIntroScreen = VeriffSdk.checkCustomIntro(configuration: configuration)
149
159
  veriffConfiguration?.vendorDataProvider = { _ in configuration[VeriffSdk.VENDOR_DATA] as? String }
150
160
 
151
161
  DispatchQueue.main.async {
@@ -194,14 +204,6 @@ class VeriffSdk: NSObject {
194
204
  previousKeyWindow?.makeKey()
195
205
  previousKeyWindow = nil
196
206
  }
197
-
198
- private static func checkCustomIntro(configuration:[String: Any]) -> Bool {
199
- if let useCustomIntro = configuration[VeriffSdk.USE_CUSTOM_INTRO_SCREEN] as? Bool {
200
- return useCustomIntro
201
- } else {
202
- return false
203
- }
204
- }
205
207
  }
206
208
 
207
209
  extension VeriffSdk: VeriffSdkDelegate {
@@ -225,12 +227,17 @@ extension VeriffSdk: VeriffSdkDelegate {
225
227
  resultDict[VeriffSdk.ERROR] = VeriffSdk.ERROR_NETWORK
226
228
  case .serverError,
227
229
  .videoFailed,
228
- .localError:
230
+ .localError,
231
+ .documentHasNoNFC,
232
+ .nfcScanError,
233
+ .uploadLimitReached:
229
234
  resultDict[VeriffSdk.ERROR] = VeriffSdk.ERROR_SESSION
230
235
  case .unknown:
231
236
  resultDict[VeriffSdk.ERROR] = VeriffSdk.ERROR_UNKNOWN
232
237
  case .deprecatedSDKVersion:
233
238
  resultDict[VeriffSdk.ERROR] = VeriffSdk.ERROR_UNSUPPORTED_SDK_VERSION
239
+ case .deviceHasNoNFC:
240
+ resultDict[VeriffSdk.ERROR] = VeriffSdk.ERROR_DEVICE_HAS_NO_NFC
234
241
  @unknown default:
235
242
  assertionFailure("Unknown error: \(err)")
236
243
  resultDict[VeriffSdk.ERROR] = VeriffSdk.ERROR_UNKNOWN
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@veriff/react-native-sdk",
3
3
  "title": "React Native Veriff SDK",
4
- "version": "13.1.0",
4
+ "version": "14.0.0",
5
5
  "description": "React Native SDK for Veriff identity verification",
6
6
  "main": "index.js",
7
7
  "scripts": {
@@ -25,28 +25,28 @@
25
25
  "licenseFilename": "LICENSE",
26
26
  "readmeFilename": "README.md",
27
27
  "peerDependencies": {
28
- "react": "^19.1.0",
29
- "react-native": "^0.81.0"
28
+ "react": "^19.2.0",
29
+ "react-native": "^0.86.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@babel/core": "^7.25.2",
33
33
  "@babel/preset-env": "^7.25.3",
34
34
  "@babel/runtime": "^7.25.0",
35
- "@react-native-community/cli": "20.0.0",
36
- "@react-native-community/cli-platform-android": "20.0.0",
37
- "@react-native-community/cli-platform-ios": "20.0.0",
38
- "@react-native/babel-preset": "^0.81.0",
39
- "@react-native/eslint-config": "^0.81.0",
40
- "@react-native/metro-config": "^0.81.0",
41
- "@react-native/typescript-config": "^0.81.0",
42
- "@types/react": "^19.1.0",
35
+ "@react-native-community/cli": "20.1.0",
36
+ "@react-native-community/cli-platform-android": "20.1.0",
37
+ "@react-native-community/cli-platform-ios": "20.1.0",
38
+ "@react-native/babel-preset": "^0.86.0",
39
+ "@react-native/eslint-config": "^0.86.0",
40
+ "@react-native/metro-config": "^0.86.0",
41
+ "@react-native/typescript-config": "^0.86.0",
42
+ "@types/react": "^19.2.0",
43
43
  "@types/react-test-renderer": "^19.1.0",
44
44
  "eslint": "^8.19.0",
45
45
  "prettier": "2.8.8",
46
- "react-test-renderer": "19.1.0",
46
+ "react-test-renderer": "19.2.3",
47
47
  "typescript": "^5.8.3"
48
48
  },
49
49
  "engines": {
50
- "node": ">=18"
50
+ "node": "^20.19.4 || ^22.13.0 || >=24.3.0"
51
51
  }
52
52
  }
@@ -20,5 +20,5 @@ Pod::Spec.new do |s|
20
20
  s.requires_arc = true
21
21
 
22
22
  s.dependency "React"
23
- s.dependency "VeriffSDK", "10.2.0"
23
+ s.dependency "VeriffSDK", "14.0.0"
24
24
  end