@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.
- package/android/build.gradle +1 -1
- package/app.plugin.js +49 -8
- package/ios/Podfile +1 -1
- package/package.json +1 -1
- package/react-native-sdk.podspec +1 -1
package/android/build.gradle
CHANGED
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
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
package/package.json
CHANGED
package/react-native-sdk.podspec
CHANGED