@veriff/react-native-sdk 5.1.0 → 6.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.
@@ -43,5 +43,5 @@ dependencies {
43
43
  //noinspection GradleDynamicVersion
44
44
  implementation 'com.facebook.react:react-android:+'
45
45
 
46
- implementation 'com.veriff:veriff-library:6.11.0'
46
+ implementation 'com.veriff:veriff-library:6.13.0'
47
47
  }
@@ -97,6 +97,7 @@ public class VeriffSdkModule extends ReactContextBaseJavaModule {
97
97
  public static final String KEY_BUTTON_RADIUS = "buttonRadius";
98
98
  private static final String KEY_CUSTOM_INTRO_SCREEN = "customIntroScreen";
99
99
  private static final String KEY_RN_IMAGE_URI = "uri";
100
+ private static final String KEY_RN_VENDOR_DATA = "vendorData";
100
101
 
101
102
  private static final String KEY_FONT = "androidFont";
102
103
 
@@ -330,6 +331,10 @@ public class VeriffSdkModule extends ReactContextBaseJavaModule {
330
331
  configBuilder.locale(Locale.forLanguageTag(configuration.getString(KEY_LOCALE)));
331
332
  }
332
333
 
334
+ if (configuration.hasKey(KEY_RN_VENDOR_DATA)) {
335
+ configBuilder.vendorData(configuration.getString(KEY_RN_VENDOR_DATA));
336
+ }
337
+
333
338
  Intent intent = Sdk.createLaunchIntent(activity, startUrl, configBuilder.build());
334
339
  activity.startActivityForResult(intent, VERIFF_REQUEST_CODE);
335
340
 
package/app.plugin.js CHANGED
@@ -7,14 +7,55 @@ const {
7
7
  const pkg = require('@veriff/react-native-sdk/package.json');
8
8
 
9
9
  function getUpdatedProjectGradle(buildGradle) {
10
- const insertIndex = buildGradle.indexOf('mavenLocal()');
11
- const updatedBuildGradle = [
12
- buildGradle.slice(0, insertIndex),
13
- 'maven { url "https://cdn.veriff.me/android/" } //veriff\n ',
14
- buildGradle.slice(insertIndex),
15
- ].join('');
16
-
17
- return updatedBuildGradle;
10
+ const insertIndex = getInsertIndex(buildGradle);
11
+
12
+ // Skip adding maven url if no insertion points found
13
+ if (insertIndex !== -1) {
14
+ const updatedBuildGradle = [
15
+ buildGradle.slice(0, insertIndex),
16
+ "maven { url 'https://cdn.veriff.me/android/' } //veriff\n ",
17
+ buildGradle.slice(insertIndex),
18
+ ].join('');
19
+
20
+ return updatedBuildGradle;
21
+ }
22
+ return buildGradle;
23
+ }
24
+
25
+ function getInsertIndex(buildGradle) {
26
+ // legacy logic, left for backward compatability
27
+ const mavenLocalIndex = buildGradle.indexOf('mavenLocal()');
28
+ if (mavenLocalIndex !== -1) {
29
+ console.log(`found "mavenLocal()" at index ${mavenLocalIndex}`);
30
+ return mavenLocalIndex;
31
+ }
32
+
33
+ // logic to support new Expo build.gradle file structure
34
+ const allprojectsIndex = buildGradle.indexOf('allprojects');
35
+ if (allprojectsIndex !== -1) {
36
+ console.log(`found "allprojects" at index ${allprojectsIndex}`);
37
+ // repositories after or "inside" of allprojects
38
+ const repositoriesIndex = buildGradle.indexOf(
39
+ 'repositories',
40
+ allprojectsIndex,
41
+ );
42
+ if (repositoriesIndex !== -1) {
43
+ console.log(`found "repositories" at index ${repositoriesIndex}`);
44
+ // mavenCentral() after or "inside" of repositories
45
+ const mavenCentralIndex = buildGradle.indexOf(
46
+ 'mavenCentral()',
47
+ repositoriesIndex,
48
+ );
49
+ if (mavenCentralIndex !== -1) {
50
+ console.log(`found "mavenCentral()" at index ${mavenCentralIndex}`);
51
+ return mavenCentralIndex;
52
+ }
53
+ }
54
+ }
55
+
56
+ console.log('mavenLocal() or mavenCentral() not found!');
57
+
58
+ return -1;
18
59
  }
19
60
 
20
61
  function withVeriffProjectGradle(expoConfig) {
package/babel.config.js CHANGED
@@ -1,3 +1,3 @@
1
1
  module.exports = {
2
- presets: ['module:metro-react-native-babel-preset'],
2
+ presets: ['module:@react-native/babel-preset'],
3
3
  };
package/ios/Podfile CHANGED
@@ -1,4 +1,4 @@
1
- platform :ios, '12.4'
1
+ platform :ios, '13.4'
2
2
 
3
3
  # Resolve react_native_pods.rb with node to allow for hoisting
4
4
  require Pod::Executable.execute_command('node', ['-p',
@@ -9,12 +9,10 @@ require Pod::Executable.execute_command('node', ['-p',
9
9
 
10
10
  target 'VeriffSdk' do
11
11
  # Pods for VeriffSdk
12
- pod 'VeriffSDK', '6.22.0'
12
+ pod 'VeriffSDK', '6.23.0'
13
13
 
14
14
  config = use_native_modules!
15
15
 
16
- # Flags change depending on the env values.
17
- flags = get_default_flags()
18
16
  use_react_native!(
19
17
  :path => config[:reactNativePath]
20
18
  )
@@ -29,6 +29,7 @@ class VeriffSdk: NSObject {
29
29
  private static let LOCALE = "locale"
30
30
  private static let LOGO = "logo"
31
31
  private static let USE_CUSTOM_INTRO_SCREEN = "customIntroScreen"
32
+ private static let VENDOR_DATA = "vendorData"
32
33
 
33
34
  private static let STATUS = "status"
34
35
  private static let ERROR = "error"
@@ -118,7 +119,6 @@ class VeriffSdk: NSObject {
118
119
  }
119
120
 
120
121
  veriffConfiguration = Veriff.VeriffSdk.Configuration(branding: veriffBranding, languageLocale: locale)
121
- veriffConfiguration?.customIntroScreen = VeriffSdk.checkCustomIntro(configuration: configuration)
122
122
  } else if let sessionToken = configuration[VeriffSdk.SESSION_TOKEN] as? String {
123
123
  // Using deprecated API
124
124
  let baseURLString = configuration[VeriffSdk.BASE_URL] as? String ?? VeriffSdk.DEFAULT_BASE_URL
@@ -128,13 +128,15 @@ class VeriffSdk: NSObject {
128
128
  sessionURL = baseURL.appendingPathComponent(sessionToken)
129
129
 
130
130
  veriffConfiguration = Veriff.VeriffSdk.Configuration(branding: veriffBranding)
131
- veriffConfiguration?.customIntroScreen = VeriffSdk.checkCustomIntro(configuration: configuration)
132
131
  } else {
133
132
  // Failed to configure
134
133
  reject(VeriffSdk.ERROR_INVALID_ARGS, "No sessionUrl or sessionToken in Veriff SDK configuration", nil)
135
134
  return
136
135
  }
137
136
 
137
+ veriffConfiguration?.customIntroScreen = VeriffSdk.checkCustomIntro(configuration: configuration)
138
+ veriffConfiguration?.vendorData = configuration[VeriffSdk.VENDOR_DATA] as? String
139
+
138
140
  DispatchQueue.main.async {
139
141
  self.resolve = resolve
140
142
  self.reject = reject
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": "5.1.0",
4
+ "version": "6.0.0",
5
5
  "description": "React Native SDK for Veriff identity verification",
6
6
  "main": "index.js",
7
7
  "scripts": {
@@ -28,16 +28,16 @@
28
28
  "readmeFilename": "README.md",
29
29
  "peerDependencies": {
30
30
  "react": "18.2.0",
31
- "react-native": "^0.72.0"
31
+ "react-native": "^0.73.0"
32
32
  },
33
33
  "devDependencies": {
34
- "@react-native/eslint-config": "^0.72.2",
35
- "@react-native/metro-config": "^0.72.6",
34
+ "@react-native/eslint-config": "^0.73.1",
35
+ "@react-native/metro-config": "^0.73.2",
36
36
  "@rnx-kit/align-deps": "^2.2.0",
37
37
  "eslint": "^8.19.0",
38
- "prettier": "^2.4.1",
38
+ "prettier": "2.8.8",
39
39
  "react": "18.2.0",
40
- "react-native": "0.72.0"
40
+ "react-native": "0.73.0"
41
41
  },
42
42
  "resolutions": {
43
43
  "ansi-regex": "^5.0.1",
@@ -66,10 +66,10 @@
66
66
  "alignDeps": {
67
67
  "requirements": {
68
68
  "development": [
69
- "react-native@0.71"
69
+ "react-native@0.73"
70
70
  ],
71
71
  "production": [
72
- "react-native@0.71"
72
+ "react-native@0.73"
73
73
  ]
74
74
  },
75
75
  "capabilities": [
@@ -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", "6.22.0"
23
+ s.dependency "VeriffSDK", "6.23.0"
24
24
  end