react-native-acoustic-connect-beta 18.0.11 → 18.0.12
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/Examples/SampleUI/ConnectConfig.json +180 -0
- package/Examples/SampleUI/android/app/build.gradle +2 -0
- package/Examples/SampleUI/android/app/src/main/AndroidManifest.xml +18 -13
- package/Examples/SampleUI/android/app/src/main/java/com/sampleui/MainActivity.kt +47 -5
- package/Examples/SampleUI/ios/SampleUI.xcodeproj/xcshareddata/xcschemes/SampleUI.xcscheme +17 -0
- package/Examples/SampleUI/metro.config.js +2 -1
- package/Examples/SampleUI/package.json +3 -2
- package/Examples/SampleUI/src/RootNavigator.tsx +10 -1
- package/README.md +4 -0
- package/android/src/main/assets/ConnectAdvancedConfig.json +1 -1
- package/lib/commonjs/components/Connect.js +98 -0
- package/lib/commonjs/components/Connect.js.map +1 -0
- package/lib/commonjs/index.js +10 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/components/Connect.js +91 -0
- package/lib/module/components/Connect.js.map +1 -0
- package/lib/module/index.js +2 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/components/Connect.d.ts +17 -0
- package/lib/typescript/src/components/Connect.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +2 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/react-native-acoustic-connect.nitro.d.ts.map +1 -1
- package/package.json +1 -1
- package/scripts/ConnectConfig.json +1 -1
- package/scripts/javaParser.js +1 -1
- package/src/components/Connect.tsx +110 -0
- package/src/index.ts +3 -3
- package/src/specs/react-native-acoustic-connect.nitro.ts +1 -15
- package/Examples/SampleUI/package-lock.json +0 -17033
- package/jslib/components/Connect.js +0 -85
- package/lib/commonjs/types.js +0 -24
- package/lib/commonjs/types.js.map +0 -1
- package/lib/module/types.js +0 -24
- package/lib/module/types.js.map +0 -1
- package/lib/typescript/jslib/components/Connect.d.ts +0 -4
- package/lib/typescript/jslib/components/Connect.d.ts.map +0 -1
- package/lib/typescript/src/types.d.ts +0 -1
- package/lib/typescript/src/types.d.ts.map +0 -1
- package/src/types.ts +0 -23
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NitroModules","AcousticConnectRN","createHybridObject"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,YAAY,QAAQ,4BAA4B;AAEzD;;
|
|
1
|
+
{"version":3,"names":["NitroModules","Connect","AcousticConnectRN","createHybridObject"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,YAAY,QAAQ,4BAA4B;AAEzD,OAAOC,OAAO,MAAM,sBAAsB,EAAC;;AAE3C,MAAMC,iBAAiB,GAAGF,YAAY,CAACG,kBAAkB,CAAwB,mBAAmB,CAAC;AAErG,SAASF,OAAO,GAAE,CAAC;AACnB,eAAeC,iBAAiB","ignoreList":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/********************************************************************************************
|
|
2
|
+
* Copyright (C) 2025 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
|
+
import React from "react";
|
|
11
|
+
interface ConnectProps {
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
captureKeyboardEvents: boolean;
|
|
14
|
+
}
|
|
15
|
+
declare const Connect: React.FC<ConnectProps>;
|
|
16
|
+
export default Connect;
|
|
17
|
+
//# sourceMappingURL=Connect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Connect.d.ts","sourceRoot":"","sources":["../../../../src/components/Connect.tsx"],"names":[],"mappings":"AAAA;;;;;;;;6FAQ6F;AAC7F,OAAO,KAAyC,MAAM,OAAO,CAAC;AAK9D,UAAU,YAAY;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,qBAAqB,EAAE,OAAO,CAAC;CAClC;AAED,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAyEnC,CAAC;AAWF,eAAe,OAAO,CAAC"}
|
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
*
|
|
12
12
|
********************************************************************************************/
|
|
13
13
|
import type { AcousticConnectRN as AcousticConnectRNSpec } from './specs/react-native-acoustic-connect.nitro';
|
|
14
|
+
import Connect from './components/Connect';
|
|
14
15
|
declare const AcousticConnectRN: AcousticConnectRNSpec;
|
|
16
|
+
export { Connect };
|
|
15
17
|
export default AcousticConnectRN;
|
|
16
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;6FAW6F;AAG7F,OAAO,KAAK,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,MAAM,6CAA6C,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;6FAW6F;AAG7F,OAAO,KAAK,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,MAAM,6CAA6C,CAAA;AAC7G,OAAO,OAAO,MAAM,sBAAsB,CAAA;AAE1C,QAAA,MAAM,iBAAiB,uBAA8E,CAAA;AAErG,OAAO,EAAE,OAAO,EAAE,CAAA;AAClB,eAAe,iBAAiB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-native-acoustic-connect.nitro.d.ts","sourceRoot":"","sources":["../../../../src/specs/react-native-acoustic-connect.nitro.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"react-native-acoustic-connect.nitro.d.ts","sourceRoot":"","sources":["../../../../src/specs/react-native-acoustic-connect.nitro.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAG9D,MAAM,MAAM,cAAc,GAAG;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,QAAQ,GAAG,iBAAiB,GAAG,MAAM,CAAA;AAE9E,MAAM,WAAW,iBAAkB,SAAQ,YAAY,CAAC;IAAE,GAAG,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,QAAQ,CAAA;CAAE,CAAC;IACxF,0BAA0B,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAA;IACpF,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAA;IAC5E,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAA;IAC5E,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAA;IAC/F,0BAA0B,CAAC,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAA;IACzF,mBAAmB,CAAC,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,IAAI,GAAG,SAAS,GAAG,OAAO,CAAA;IACnH,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAA;CACxD"}
|
package/package.json
CHANGED
|
@@ -193,7 +193,7 @@
|
|
|
193
193
|
"source": "src/index",
|
|
194
194
|
"summary": "react-native ios android tealeaf connect cxa wxca er enhanced-replay",
|
|
195
195
|
"types": "./lib/typescript/src/index.d.ts",
|
|
196
|
-
"version": "18.0.
|
|
196
|
+
"version": "18.0.12",
|
|
197
197
|
"workspaces": [
|
|
198
198
|
"example"
|
|
199
199
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"Connect": {
|
|
3
|
-
"AndroidVersion": "10.4.
|
|
3
|
+
"AndroidVersion": "10.4.37",
|
|
4
4
|
"AppKey": "b6c3709b7a4c479bb4b5a9fb8fec324c",
|
|
5
5
|
"KillSwitchUrl": "https://lib-us-2.brilliantcollector.com/collector/switch/b6c3709b7a4c479bb4b5a9fb8fec324c",
|
|
6
6
|
"PostMessageUrl": "https://lib-us-2.brilliantcollector.com/collector/collectorPost",
|
package/scripts/javaParser.js
CHANGED
|
@@ -172,7 +172,7 @@ if (updateMainActivity) {
|
|
|
172
172
|
console.log("File to be saved:\n" + updateMainActivityData);
|
|
173
173
|
|
|
174
174
|
try {
|
|
175
|
-
|
|
175
|
+
fs.writeFileSync(mainActivityPath, updateMainActivityData);
|
|
176
176
|
console.log("Updated:" + mainActivityPath);
|
|
177
177
|
} catch (err) {
|
|
178
178
|
console.log("Error writing:" + mainActivityPath);
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/********************************************************************************************
|
|
2
|
+
* Copyright (C) 2025 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
|
+
import React, { useCallback, useEffect, useRef } from "react";
|
|
11
|
+
import { View, StyleSheet, Platform, NativeModules, findNodeHandle } from "react-native";
|
|
12
|
+
import type { LayoutChangeEvent } from "react-native"; // Use type-only import for LayoutChangeEvent
|
|
13
|
+
// import TLTRN from '../TLTRN';
|
|
14
|
+
|
|
15
|
+
interface ConnectProps {
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
captureKeyboardEvents: boolean;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const Connect: React.FC<ConnectProps> = ({ children, captureKeyboardEvents }) => {
|
|
21
|
+
const navigation = (children as any).ref; // Type assertion for children with ref
|
|
22
|
+
const currentRoute = useRef<string | undefined>(undefined);
|
|
23
|
+
const initial = useRef<boolean>(false);
|
|
24
|
+
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
// TLTRN.interceptKeyboardEvents(captureKeyboardEvents);
|
|
27
|
+
}, [captureKeyboardEvents]);
|
|
28
|
+
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (
|
|
31
|
+
!navigation ||
|
|
32
|
+
typeof navigation.current.addListener !== "function" ||
|
|
33
|
+
typeof navigation.current.getCurrentRoute !== "function"
|
|
34
|
+
) {
|
|
35
|
+
console.warn(
|
|
36
|
+
"Connect: The Connect component's first child must be a NavigationContainer with a ref."
|
|
37
|
+
);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const unsubscribe = navigation.current.addListener("state", () => {
|
|
42
|
+
currentRoute.current = extractName(navigation) || navigation.current.getCurrentRoute()?.name;
|
|
43
|
+
console.log("State change - ", currentRoute.current);
|
|
44
|
+
|
|
45
|
+
if (Platform.OS === "ios" && currentRoute && currentRoute.current) {
|
|
46
|
+
// TLTRN.setCurrentScreenName(currentRoute.current);
|
|
47
|
+
} else if (Platform.OS === "android") {
|
|
48
|
+
// TLTRN.setCurrentScreenName(currentRoute.current);
|
|
49
|
+
// TLTRN.logScreenLayout(currentRoute.current);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
return unsubscribe;
|
|
54
|
+
}, [navigation]);
|
|
55
|
+
|
|
56
|
+
const onStartShouldSetResponderCapture = useCallback((event: any) => {
|
|
57
|
+
currentRoute.current = extractName(navigation) || navigation.current.getCurrentRoute()?.name;
|
|
58
|
+
if (currentRoute && currentRoute.current) {
|
|
59
|
+
// TLTRN.setCurrentScreenName(currentRoute.current);
|
|
60
|
+
}
|
|
61
|
+
// Log the click event
|
|
62
|
+
console.log("event - ", event.nativeEvent);
|
|
63
|
+
// TLTRN.logClickEvent(event);
|
|
64
|
+
return false; // Must be false; true means this component becomes the touch responder and events don't bubble
|
|
65
|
+
}, []);
|
|
66
|
+
|
|
67
|
+
const onLayout = useCallback((event: LayoutChangeEvent) => {
|
|
68
|
+
if (initial.current) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
initial.current = true;
|
|
72
|
+
|
|
73
|
+
console.log("event - ", event.nativeEvent);
|
|
74
|
+
|
|
75
|
+
currentRoute.current = navigation.current.getCurrentRoute()?.name;
|
|
76
|
+
if (Platform.OS === "ios" && currentRoute && currentRoute.current) {
|
|
77
|
+
// TLTRN.setCurrentScreenName(currentRoute.current);
|
|
78
|
+
} else if (Platform.OS === "android") {
|
|
79
|
+
// TLTRN.logScreenLayout(currentRoute.current);
|
|
80
|
+
}
|
|
81
|
+
return true
|
|
82
|
+
}, [navigation]);
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
<View
|
|
86
|
+
style={styles.connect_main}
|
|
87
|
+
onLayout={onLayout}
|
|
88
|
+
onStartShouldSetResponderCapture={onStartShouldSetResponderCapture}
|
|
89
|
+
>
|
|
90
|
+
{children}
|
|
91
|
+
</View>
|
|
92
|
+
);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
function extractName(navigation: any): string {
|
|
96
|
+
const routeParams = navigation.current.getCurrentRoute()?.params;
|
|
97
|
+
if (routeParams) {
|
|
98
|
+
const { name } = routeParams;
|
|
99
|
+
return name || "";
|
|
100
|
+
}
|
|
101
|
+
return "";
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export default Connect;
|
|
105
|
+
|
|
106
|
+
const styles = StyleSheet.create({
|
|
107
|
+
connect_main: {
|
|
108
|
+
flex: 1,
|
|
109
|
+
},
|
|
110
|
+
});
|
package/src/index.ts
CHANGED
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
|
|
14
14
|
import { NitroModules } from 'react-native-nitro-modules'
|
|
15
15
|
import type { AcousticConnectRN as AcousticConnectRNSpec } from './specs/react-native-acoustic-connect.nitro'
|
|
16
|
-
|
|
16
|
+
import Connect from './components/Connect' // Import Connect.tsx
|
|
17
17
|
|
|
18
|
-
const AcousticConnectRN =
|
|
19
|
-
NitroModules.createHybridObject<AcousticConnectRNSpec>('AcousticConnectRN')
|
|
18
|
+
const AcousticConnectRN = NitroModules.createHybridObject<AcousticConnectRNSpec>('AcousticConnectRN')
|
|
20
19
|
|
|
20
|
+
export { Connect } // Export Connect.tsx
|
|
21
21
|
export default AcousticConnectRN
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright (C)
|
|
1
|
+
// Copyright (C) 2025 Acoustic, L.P. All rights reserved.
|
|
2
2
|
//
|
|
3
3
|
// NOTICE: This file contains material that is confidential and proprietary to
|
|
4
4
|
// Acoustic, L.P. and/or other developers. No license is granted under any intellectual or
|
|
@@ -11,19 +11,6 @@
|
|
|
11
11
|
//
|
|
12
12
|
|
|
13
13
|
import { type HybridObject } from 'react-native-nitro-modules'
|
|
14
|
-
// import { type HybridObject, type AnyMap } from 'react-native-nitro-modules'
|
|
15
|
-
// import type { ConnectionType, NetworkInfoListener } from '../types'
|
|
16
|
-
|
|
17
|
-
// // Define a custom type for the values parameter with limited recursion
|
|
18
|
-
// export type KeyValueMap = {
|
|
19
|
-
// placeholder: string; // Add a placeholder property to avoid the "empty struct" error
|
|
20
|
-
// [key: string]: string | number | boolean | null | KeyValueMapLevel1;
|
|
21
|
-
// };
|
|
22
|
-
|
|
23
|
-
// // Define a second level to limit recursion
|
|
24
|
-
// export type KeyValueMapLevel1 = {
|
|
25
|
-
// [key: string]: string | number | boolean | null;
|
|
26
|
-
// };
|
|
27
14
|
|
|
28
15
|
// Define a named type for the anonymous object
|
|
29
16
|
export type KeyValueObject = {
|
|
@@ -33,7 +20,6 @@ export type KeyValueObject = {
|
|
|
33
20
|
|
|
34
21
|
export type ConnectMonitoringLevelType = 'Ignore' | 'CellularAndWiFi' | 'WiFi'
|
|
35
22
|
|
|
36
|
-
|
|
37
23
|
export interface AcousticConnectRN extends HybridObject<{ ios: 'swift', android: 'kotlin' }> {
|
|
38
24
|
setBooleanConfigItemForKey(key: string, value: boolean, moduleName: string): boolean
|
|
39
25
|
setStringItemForKey(key: string, value: string, moduleName: string): boolean
|