@veriff/react-native-sdk 5.0.0 → 5.2.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.12.0'
47
47
  }
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/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', '6.17.0'
12
+ pod 'VeriffSDK', '6.22.0'
13
13
 
14
14
  config = use_native_modules!
15
15
 
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.0.0",
4
+ "version": "5.2.0",
5
5
  "description": "React Native SDK for Veriff identity verification",
6
6
  "main": "index.js",
7
7
  "scripts": {
@@ -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.17.0"
23
+ s.dependency "VeriffSDK", "6.22.0"
24
24
  end