react-native-acoustic-connect-beta 18.0.37 → 18.0.39

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.
@@ -1,87 +0,0 @@
1
- /********************************************************************************************
2
- * Copyright (C) 2024 Acoustic, L.P. All rights reserved.
3
- *
4
- * NOTICE: This file contains material that is confidential and proprietary to
5
- * Acoustic, L.P. and/or other developers. No license is granted under any intellectual or
6
- * industrial property rights of Acoustic, L.P. except as may be provided in an agreement with
7
- * Acoustic, L.P. Any unauthorized copying or distribution of content from this file is
8
- * prohibited.
9
- ********************************************************************************************/
10
-
11
- /**
12
- * Verify and Update React Native SDK integration to capture screen tracking.
13
- *
14
- * cd node_modules/react-native-acoustic-connect-beta folder
15
- *
16
- * yarn run verifyConnectSetup
17
- *
18
- */
19
- const fs = require('fs');
20
-
21
- //const filePath = "../../src/components/RootComponent.tsx"
22
- const filePath = "Example/nativebase-v3-kitchensink/src/components/RootComponent.tsx"
23
-
24
- function log(message) {
25
- console.log(message);
26
- }
27
-
28
- function isRootFileAvailable() {
29
- return fs.existsSync(filePath);
30
- }
31
-
32
- function isConnectComponentAvailable() {
33
- log("Looking for Connect tag...");
34
- return isComponentAvailable(/<Connect/);
35
- }
36
-
37
- function isNavigationContainerAvailable() {
38
- log("Looking for NavigationContainer tag...");
39
- return isComponentAvailable(/<NavigationContainer/);
40
- }
41
-
42
- function isComponentAvailable(componentTag) {
43
- try {
44
- let data = fs.readFileSync(filePath, 'utf8');
45
- const re = new RegExp(componentTag, "g");
46
- const found = re.test(data);
47
-
48
- return found;
49
- } catch (err) {
50
- console.error(err);
51
- }
52
- }
53
-
54
- if (isRootFileAvailable()) {
55
- if (isConnectComponentAvailable()) {
56
- log("Connect component found. You are ready to go!");
57
- } else if (isNavigationContainerAvailable()) {
58
- log("NavigationContainer component is available but Connect component is missing.\n I'll add Connect around NavigationContainer component.");
59
- AddConnectComponent();
60
- } else {
61
- log("Missing both Connect and NavigationContainer component.\n Please refer to SDK integration without React Navigation.");
62
- };
63
- } else {
64
- console.error("App.js file not found in root app folder.");
65
- }
66
-
67
- // Update and add Connect around NavigationContainer
68
- function AddConnectComponent() {
69
- const connectImport = `import { Connect } from 'react-native-acoustic-connect-beta';`
70
-
71
- const startNavigationContainer = /<NavigationContainer/
72
- const startConnectComponent = `<Connect><NavigationContainer`
73
-
74
- const endNavigationContainer = /<\/NavigationContainer>/
75
- const endConnectComponent = `</NavigationContainer></Connect>`
76
-
77
- try {
78
- let data = fs.readFileSync(filePath, 'utf8');
79
- data = data
80
- .replace(startNavigationContainer, startConnectComponent)
81
- .replace(endNavigationContainer, endConnectComponent);
82
- fs.writeFileSync(filePath, ConnectImport + '\n' + data);
83
- } catch (err) {
84
- log("Something went wrong.\n Please refer to SDK integration with React Navigation.");
85
- console.error(err);
86
- }
87
- }