react-native-acoustic-connect-beta 18.0.14 → 18.0.16

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.
Files changed (97) hide show
  1. package/Examples/SampleUI/.detoxrc.js +83 -0
  2. package/Examples/SampleUI/ConnectConfig.json +2 -2
  3. package/Examples/SampleUI/android/app/build.gradle +3 -0
  4. package/Examples/SampleUI/android/app/src/main/java/com/sampleui/MainActivity.kt +0 -35
  5. package/Examples/SampleUI/android/settings.gradle +1 -1
  6. package/Examples/SampleUI/package.json +8 -6
  7. package/Examples/SampleUI/scripts/integration-test-android.sh +292 -0
  8. package/Examples/SampleUI/src/Examples/DialogExample.tsx +88 -2
  9. package/Examples/SampleUI/src/Examples/Dialogs/DialogTrackingTest.tsx +307 -0
  10. package/Examples/SampleUI/src/Examples/Dialogs/index.tsx +37 -0
  11. package/Examples/SampleUI/src/index.native.tsx +4 -5
  12. package/android/build.gradle +2 -2
  13. package/android/src/main/assets/ConnectAdvancedConfig.json +1 -1
  14. package/android/src/main/java/com/acousticconnectrn/HybridAcousticConnectRN.kt +787 -490
  15. package/ios/HybridAcousticConnectRN.swift +75 -0
  16. package/lib/commonjs/TLTRN.js +69 -0
  17. package/lib/commonjs/TLTRN.js.map +1 -1
  18. package/lib/commonjs/components/Connect.js +5 -1
  19. package/lib/commonjs/components/Connect.js.map +1 -1
  20. package/lib/commonjs/docs/DialogTracking.md +252 -0
  21. package/lib/commonjs/docs/NativeImplementation.md +176 -0
  22. package/lib/commonjs/examples/DialogTrackingExample.js +175 -0
  23. package/lib/commonjs/examples/DialogTrackingExample.js.map +1 -0
  24. package/lib/commonjs/examples/HOCDialogExample.js +296 -0
  25. package/lib/commonjs/examples/HOCDialogExample.js.map +1 -0
  26. package/lib/commonjs/index.js +28 -0
  27. package/lib/commonjs/index.js.map +1 -1
  28. package/lib/commonjs/utils/DialogDebugger.js +216 -0
  29. package/lib/commonjs/utils/DialogDebugger.js.map +1 -0
  30. package/lib/commonjs/utils/DialogListener.js +203 -0
  31. package/lib/commonjs/utils/DialogListener.js.map +1 -0
  32. package/lib/commonjs/utils/useDialogTracking.js +107 -0
  33. package/lib/commonjs/utils/useDialogTracking.js.map +1 -0
  34. package/lib/commonjs/utils/withAcousticAutoDialog.js +282 -0
  35. package/lib/commonjs/utils/withAcousticAutoDialog.js.map +1 -0
  36. package/lib/module/TLTRN.js +69 -0
  37. package/lib/module/TLTRN.js.map +1 -1
  38. package/lib/module/components/Connect.js +5 -1
  39. package/lib/module/components/Connect.js.map +1 -1
  40. package/lib/module/docs/DialogTracking.md +252 -0
  41. package/lib/module/docs/NativeImplementation.md +176 -0
  42. package/lib/module/examples/DialogTrackingExample.js +172 -0
  43. package/lib/module/examples/DialogTrackingExample.js.map +1 -0
  44. package/lib/module/examples/HOCDialogExample.js +292 -0
  45. package/lib/module/examples/HOCDialogExample.js.map +1 -0
  46. package/lib/module/index.js +5 -1
  47. package/lib/module/index.js.map +1 -1
  48. package/lib/module/utils/DialogDebugger.js +211 -0
  49. package/lib/module/utils/DialogDebugger.js.map +1 -0
  50. package/lib/module/utils/DialogListener.js +199 -0
  51. package/lib/module/utils/DialogListener.js.map +1 -0
  52. package/lib/module/utils/useDialogTracking.js +102 -0
  53. package/lib/module/utils/useDialogTracking.js.map +1 -0
  54. package/lib/module/utils/withAcousticAutoDialog.js +275 -0
  55. package/lib/module/utils/withAcousticAutoDialog.js.map +1 -0
  56. package/lib/typescript/src/TLTRN.d.ts +7 -0
  57. package/lib/typescript/src/TLTRN.d.ts.map +1 -1
  58. package/lib/typescript/src/components/Connect.d.ts +1 -0
  59. package/lib/typescript/src/components/Connect.d.ts.map +1 -1
  60. package/lib/typescript/src/examples/DialogTrackingExample.d.ts +17 -0
  61. package/lib/typescript/src/examples/DialogTrackingExample.d.ts.map +1 -0
  62. package/lib/typescript/src/examples/HOCDialogExample.d.ts +21 -0
  63. package/lib/typescript/src/examples/HOCDialogExample.d.ts.map +1 -0
  64. package/lib/typescript/src/index.d.ts +5 -1
  65. package/lib/typescript/src/index.d.ts.map +1 -1
  66. package/lib/typescript/src/specs/react-native-acoustic-connect.nitro.d.ts +4 -0
  67. package/lib/typescript/src/specs/react-native-acoustic-connect.nitro.d.ts.map +1 -1
  68. package/lib/typescript/src/utils/DialogDebugger.d.ts +58 -0
  69. package/lib/typescript/src/utils/DialogDebugger.d.ts.map +1 -0
  70. package/lib/typescript/src/utils/DialogListener.d.ts +85 -0
  71. package/lib/typescript/src/utils/DialogListener.d.ts.map +1 -0
  72. package/lib/typescript/src/utils/useDialogTracking.d.ts +25 -0
  73. package/lib/typescript/src/utils/useDialogTracking.d.ts.map +1 -0
  74. package/lib/typescript/src/utils/withAcousticAutoDialog.d.ts +37 -0
  75. package/lib/typescript/src/utils/withAcousticAutoDialog.d.ts.map +1 -0
  76. package/nitrogen/generated/android/c++/JHybridAcousticConnectRNSpec.cpp +26 -0
  77. package/nitrogen/generated/android/c++/JHybridAcousticConnectRNSpec.hpp +4 -0
  78. package/nitrogen/generated/android/kotlin/com/margelo/nitro/acousticconnectrn/HybridAcousticConnectRNSpec.kt +16 -0
  79. package/nitrogen/generated/ios/c++/HybridAcousticConnectRNSpecSwift.hpp +32 -0
  80. package/nitrogen/generated/ios/swift/HybridAcousticConnectRNSpec.swift +4 -0
  81. package/nitrogen/generated/ios/swift/HybridAcousticConnectRNSpec_cxx.swift +71 -0
  82. package/nitrogen/generated/shared/c++/HybridAcousticConnectRNSpec.cpp +4 -0
  83. package/nitrogen/generated/shared/c++/HybridAcousticConnectRNSpec.hpp +4 -0
  84. package/package.json +1 -1
  85. package/scripts/ConnectConfig.json +1 -1
  86. package/src/TLTRN.ts +75 -0
  87. package/src/components/Connect.tsx +6 -1
  88. package/src/docs/DialogTracking.md +252 -0
  89. package/src/docs/NativeImplementation.md +176 -0
  90. package/src/examples/DialogTrackingExample.tsx +163 -0
  91. package/src/examples/HOCDialogExample.tsx +253 -0
  92. package/src/index.ts +5 -1
  93. package/src/specs/react-native-acoustic-connect.nitro.ts +5 -0
  94. package/src/utils/DialogDebugger.ts +224 -0
  95. package/src/utils/DialogListener.ts +238 -0
  96. package/src/utils/useDialogTracking.ts +102 -0
  97. package/src/utils/withAcousticAutoDialog.tsx +312 -0
@@ -0,0 +1,253 @@
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
+
11
+ import * as React from 'react';
12
+ import { View, Text, TouchableOpacity, StyleSheet, Alert } from 'react-native';
13
+ import Connect from '../components/Connect';
14
+
15
+ /**
16
+ * Example demonstrating HOC-based Paper Dialog tracking
17
+ *
18
+ * This approach requires minimal code changes:
19
+ * 1. Create tracked versions of your dialog components
20
+ * 2. Use the tracked versions instead of the original ones
21
+ * 3. All dialog events are automatically tracked!
22
+ */
23
+ const HOCDialogExample: React.FC = () => {
24
+ const [dialogVisible, setDialogVisible] = React.useState(false);
25
+
26
+ // Example 1: React Native Alert.alert (automatically tracked)
27
+ const showAlertDialog = () => {
28
+ Alert.alert(
29
+ 'Confirmation Alert',
30
+ 'This is a native alert dialog that is automatically tracked.',
31
+ [
32
+ { text: 'Cancel', style: 'cancel' },
33
+ { text: 'OK', onPress: () => console.log('Alert OK pressed') }
34
+ ]
35
+ );
36
+ };
37
+
38
+ // Example 2: Paper Dialog with HOC tracking
39
+ const showPaperDialog = () => {
40
+ setDialogVisible(true);
41
+ };
42
+
43
+ const hidePaperDialog = () => {
44
+ setDialogVisible(false);
45
+ };
46
+
47
+ return (
48
+ <Connect captureDialogEvents={true} captureKeyboardEvents={false}>
49
+ <View style={styles.container}>
50
+ <Text style={styles.title}>HOC Dialog Tracking Example</Text>
51
+ <Text style={styles.subtitle}>
52
+ Minimal code changes required - just wrap your dialog components!
53
+ </Text>
54
+
55
+ <View style={styles.buttonContainer}>
56
+ <TouchableOpacity style={styles.button} onPress={showAlertDialog}>
57
+ <Text style={styles.buttonText}>Show Alert.alert</Text>
58
+ <Text style={styles.buttonSubtext}>Automatically tracked</Text>
59
+ </TouchableOpacity>
60
+
61
+ <TouchableOpacity style={styles.button} onPress={showPaperDialog}>
62
+ <Text style={styles.buttonText}>Show Paper Dialog (HOC)</Text>
63
+ <Text style={styles.buttonSubtext}>Minimal code changes</Text>
64
+ </TouchableOpacity>
65
+ </View>
66
+
67
+ <View style={styles.infoContainer}>
68
+ <Text style={styles.infoTitle}>How to use HOC approach:</Text>
69
+ <Text style={styles.infoText}>1. Create tracked dialog components</Text>
70
+ <Text style={styles.infoText}>2. Use tracked versions instead of originals</Text>
71
+ <Text style={styles.infoText}>3. All events automatically tracked!</Text>
72
+ <Text style={styles.infoText}>4. No manual tracking code needed</Text>
73
+ </View>
74
+
75
+ <View style={styles.codeContainer}>
76
+ <Text style={styles.codeTitle}>Example Setup Code:</Text>
77
+ <Text style={styles.codeText}>
78
+ {`// In your app setup
79
+ import { withAcousticAutoDialog } from 'react-native-acoustic-connect-beta';
80
+ import { Dialog, Portal } from 'react-native-paper';
81
+
82
+ // Create tracked versions
83
+ const TrackedDialog = withAcousticAutoDialog(Dialog);
84
+ const TrackedPortal = withAcousticAutoDialog(Portal);
85
+
86
+ // Use TrackedDialog instead of Dialog - that's it!`}
87
+ </Text>
88
+ </View>
89
+
90
+ {/* Example of how the tracked dialog would be used */}
91
+ {dialogVisible && (
92
+ <View style={styles.exampleDialog}>
93
+ <Text style={styles.dialogTitle}>Example Dialog</Text>
94
+ <Text style={styles.dialogContent}>
95
+ This shows how you would use the tracked dialog components.
96
+ In a real app, you would use TrackedDialog instead of Dialog.
97
+ </Text>
98
+ <View style={styles.dialogActions}>
99
+ <TouchableOpacity style={styles.dialogButton} onPress={hidePaperDialog}>
100
+ <Text style={styles.dialogButtonText}>Cancel</Text>
101
+ </TouchableOpacity>
102
+ <TouchableOpacity
103
+ style={[styles.dialogButton, styles.primaryButton]}
104
+ onPress={() => {
105
+ console.log('Dialog confirmed!');
106
+ hidePaperDialog();
107
+ }}
108
+ >
109
+ <Text style={styles.dialogButtonText}>Confirm</Text>
110
+ </TouchableOpacity>
111
+ </View>
112
+ </View>
113
+ )}
114
+ </View>
115
+ </Connect>
116
+ );
117
+ };
118
+
119
+ const styles = StyleSheet.create({
120
+ container: {
121
+ flex: 1,
122
+ padding: 20,
123
+ backgroundColor: '#f5f5f5',
124
+ },
125
+ title: {
126
+ fontSize: 24,
127
+ fontWeight: 'bold',
128
+ textAlign: 'center',
129
+ marginBottom: 10,
130
+ color: '#333',
131
+ },
132
+ subtitle: {
133
+ fontSize: 16,
134
+ textAlign: 'center',
135
+ marginBottom: 30,
136
+ color: '#666',
137
+ fontStyle: 'italic',
138
+ },
139
+ buttonContainer: {
140
+ gap: 15,
141
+ },
142
+ button: {
143
+ backgroundColor: '#007AFF',
144
+ padding: 15,
145
+ borderRadius: 10,
146
+ shadowColor: '#000',
147
+ shadowOffset: { width: 0, height: 2 },
148
+ shadowOpacity: 0.1,
149
+ shadowRadius: 4,
150
+ elevation: 3,
151
+ },
152
+ buttonText: {
153
+ color: 'white',
154
+ fontSize: 16,
155
+ fontWeight: '600',
156
+ textAlign: 'center',
157
+ },
158
+ buttonSubtext: {
159
+ color: 'rgba(255, 255, 255, 0.8)',
160
+ fontSize: 12,
161
+ textAlign: 'center',
162
+ marginTop: 2,
163
+ },
164
+ infoContainer: {
165
+ backgroundColor: 'white',
166
+ padding: 20,
167
+ borderRadius: 10,
168
+ marginTop: 30,
169
+ shadowColor: '#000',
170
+ shadowOffset: { width: 0, height: 1 },
171
+ shadowOpacity: 0.1,
172
+ shadowRadius: 2,
173
+ elevation: 2,
174
+ },
175
+ infoTitle: {
176
+ fontSize: 18,
177
+ fontWeight: '600',
178
+ marginBottom: 10,
179
+ color: '#333',
180
+ },
181
+ infoText: {
182
+ fontSize: 14,
183
+ color: '#666',
184
+ marginBottom: 5,
185
+ },
186
+ codeContainer: {
187
+ backgroundColor: '#f8f9fa',
188
+ padding: 15,
189
+ borderRadius: 8,
190
+ marginTop: 20,
191
+ borderLeftWidth: 4,
192
+ borderLeftColor: '#007AFF',
193
+ },
194
+ codeTitle: {
195
+ fontSize: 16,
196
+ fontWeight: '600',
197
+ marginBottom: 10,
198
+ color: '#333',
199
+ },
200
+ codeText: {
201
+ fontSize: 12,
202
+ color: '#555',
203
+ fontFamily: 'monospace',
204
+ lineHeight: 18,
205
+ },
206
+ exampleDialog: {
207
+ position: 'absolute',
208
+ top: '50%',
209
+ left: 20,
210
+ right: 20,
211
+ backgroundColor: 'white',
212
+ borderRadius: 12,
213
+ padding: 20,
214
+ shadowColor: '#000',
215
+ shadowOffset: { width: 0, height: 4 },
216
+ shadowOpacity: 0.25,
217
+ shadowRadius: 8,
218
+ elevation: 8,
219
+ },
220
+ dialogTitle: {
221
+ fontSize: 20,
222
+ fontWeight: 'bold',
223
+ marginBottom: 15,
224
+ color: '#333',
225
+ },
226
+ dialogContent: {
227
+ fontSize: 16,
228
+ color: '#666',
229
+ marginBottom: 20,
230
+ lineHeight: 22,
231
+ },
232
+ dialogActions: {
233
+ flexDirection: 'row',
234
+ justifyContent: 'flex-end',
235
+ gap: 10,
236
+ },
237
+ dialogButton: {
238
+ paddingHorizontal: 20,
239
+ paddingVertical: 10,
240
+ borderRadius: 6,
241
+ backgroundColor: '#f0f0f0',
242
+ },
243
+ primaryButton: {
244
+ backgroundColor: '#007AFF',
245
+ },
246
+ dialogButtonText: {
247
+ fontSize: 16,
248
+ fontWeight: '600',
249
+ color: '#333',
250
+ },
251
+ });
252
+
253
+ export default HOCDialogExample;
package/src/index.ts CHANGED
@@ -15,9 +15,13 @@ 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'
17
17
  import KeyboardListener from './utils/KeyboardListener'
18
+ import DialogListener from './utils/DialogListener'
19
+ import useDialogTracking from './utils/useDialogTracking'
20
+ import { withAcousticAutoDialog } from './utils/withAcousticAutoDialog'
21
+ import DialogDebugger from './utils/DialogDebugger'
18
22
  import TLTRN from './TLTRN'
19
23
 
20
24
  const AcousticConnectRN = NitroModules.createHybridObject<AcousticConnectRNSpec>('AcousticConnectRN')
21
25
 
22
- export { Connect, TLTRN, KeyboardListener}
26
+ export { Connect, TLTRN, KeyboardListener, DialogListener, useDialogTracking, DialogDebugger, withAcousticAutoDialog }
23
27
  export default AcousticConnectRN
@@ -39,4 +39,9 @@ export interface AcousticConnectRN extends HybridObject<{ ios: 'swift', android:
39
39
  logScreenViewContextLoad(logicalPageName: string | null | undefined, referrer:string | null | undefined): boolean
40
40
  logScreenViewContextUnload(logicalPageName: string | null | undefined, referrer:string | null | undefined): boolean
41
41
  logScreenLayout(name: string, delay: number): boolean
42
+ // New dialog event handling methods
43
+ logDialogShowEvent(dialogId: string, dialogTitle: string, dialogType: string): boolean
44
+ logDialogDismissEvent(dialogId: string, dismissReason: string): boolean
45
+ logDialogButtonClickEvent(dialogId: string, buttonText: string, buttonIndex: number): boolean
46
+ logDialogCustomEvent(dialogId: string, eventName: string, values: Record<string, string | number | boolean>): boolean
42
47
  }
@@ -0,0 +1,224 @@
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
+
11
+ import { Alert } from 'react-native';
12
+ import DialogListener from './DialogListener';
13
+ import TLTRN from '../TLTRN';
14
+
15
+ /**
16
+ * Debug utility for dialog event tracking
17
+ * Helps identify issues with dialog event interception and logging
18
+ */
19
+ export class DialogDebugger {
20
+ private static instance: DialogDebugger;
21
+ private isEnabled: boolean = false;
22
+ private originalAlert: typeof Alert.alert;
23
+
24
+ private constructor() {
25
+ this.originalAlert = Alert.alert;
26
+ }
27
+
28
+ static getInstance(): DialogDebugger {
29
+ if (!DialogDebugger.instance) {
30
+ DialogDebugger.instance = new DialogDebugger();
31
+ }
32
+ return DialogDebugger.instance;
33
+ }
34
+
35
+ /**
36
+ * Enable debug mode
37
+ */
38
+ enable(): void {
39
+ this.isEnabled = true;
40
+ console.log('🔍 DialogDebugger: Debug mode enabled');
41
+ }
42
+
43
+ /**
44
+ * Disable debug mode
45
+ */
46
+ disable(): void {
47
+ this.isEnabled = false;
48
+ console.log('🔍 DialogDebugger: Debug mode disabled');
49
+ }
50
+
51
+ /**
52
+ * Test the complete dialog event flow
53
+ */
54
+ testDialogEventFlow(): void {
55
+ console.log('🔍 DialogDebugger: Testing dialog event flow...');
56
+
57
+ // Test 1: Check if DialogListener is working
58
+ this.testDialogListener();
59
+
60
+ // Test 2: Check if TLTRN methods are accessible
61
+ this.testTLTRNMethods();
62
+
63
+ // Test 3: Check if Alert.alert override is working
64
+ this.testAlertOverride();
65
+
66
+ // Test 4: Test native method calls
67
+ this.testNativeMethods();
68
+ }
69
+
70
+ /**
71
+ * Test DialogListener functionality
72
+ */
73
+ private testDialogListener(): void {
74
+ console.log('🔍 DialogDebugger: Testing DialogListener...');
75
+
76
+ try {
77
+ const dialogListener = DialogListener.getInstance();
78
+ console.log('✅ DialogListener.getInstance() - SUCCESS');
79
+
80
+ // Test event listener
81
+ const unsubscribe = dialogListener.addEventListener((event) => {
82
+ console.log('🔍 DialogDebugger: DialogListener event received:', event);
83
+ });
84
+ console.log('✅ DialogListener.addEventListener() - SUCCESS');
85
+
86
+ // Test manual tracking
87
+ dialogListener.trackCustomDialogShow('test-dialog-id', 'Test Dialog', []);
88
+ console.log('✅ DialogListener.trackCustomDialogShow() - SUCCESS');
89
+
90
+ unsubscribe();
91
+ } catch (error) {
92
+ console.error('❌ DialogDebugger: DialogListener test failed:', error);
93
+ }
94
+ }
95
+
96
+ /**
97
+ * Test TLTRN methods
98
+ */
99
+ private testTLTRNMethods(): void {
100
+ console.log('🔍 DialogDebugger: Testing TLTRN methods...');
101
+
102
+ try {
103
+ // Test if TLTRN methods exist
104
+ if (typeof TLTRN.logDialogShowEvent === 'function') {
105
+ console.log('✅ TLTRN.logDialogShowEvent - EXISTS');
106
+ } else {
107
+ console.error('❌ TLTRN.logDialogShowEvent - NOT FOUND');
108
+ }
109
+
110
+ if (typeof TLTRN.interceptDialogEvents === 'function') {
111
+ console.log('✅ TLTRN.interceptDialogEvents - EXISTS');
112
+ } else {
113
+ console.error('❌ TLTRN.interceptDialogEvents - NOT FOUND');
114
+ }
115
+
116
+ // Test method call
117
+ TLTRN.logDialogShowEvent('test-dialog-id', 'Test Dialog', 'test');
118
+ console.log('✅ TLTRN.logDialogShowEvent() - CALLED');
119
+
120
+ } catch (error) {
121
+ console.error('❌ DialogDebugger: TLTRN test failed:', error);
122
+ }
123
+ }
124
+
125
+ /**
126
+ * Test Alert.alert override
127
+ */
128
+ private testAlertOverride(): void {
129
+ console.log('🔍 DialogDebugger: Testing Alert.alert override...');
130
+
131
+ try {
132
+ // Check if Alert.alert is overridden
133
+ if (Alert.alert !== this.originalAlert) {
134
+ console.log('✅ Alert.alert is overridden');
135
+ } else {
136
+ console.error('❌ Alert.alert is NOT overridden');
137
+ }
138
+
139
+ // Test Alert.alert call
140
+ Alert.alert('Debug Test', 'This is a test alert', [
141
+ { text: 'OK', onPress: () => console.log('🔍 DialogDebugger: Alert OK pressed') }
142
+ ]);
143
+ console.log('✅ Alert.alert() - CALLED');
144
+
145
+ } catch (error) {
146
+ console.error('❌ DialogDebugger: Alert.alert test failed:', error);
147
+ }
148
+ }
149
+
150
+ /**
151
+ * Test native method calls
152
+ */
153
+ private testNativeMethods(): void {
154
+ console.log('🔍 DialogDebugger: Testing native method calls...');
155
+
156
+ try {
157
+ // Import AcousticConnectRN to test native calls
158
+ const AcousticConnectRN = require('../index').default;
159
+
160
+ if (AcousticConnectRN && typeof AcousticConnectRN.logDialogShowEvent === 'function') {
161
+ console.log('✅ AcousticConnectRN.logDialogShowEvent - EXISTS');
162
+
163
+ // Test native call
164
+ const result = AcousticConnectRN.logDialogShowEvent('test-dialog-id', 'Test Dialog', 'test');
165
+ console.log('✅ AcousticConnectRN.logDialogShowEvent() - CALLED, result:', result);
166
+ } else {
167
+ console.error('❌ AcousticConnectRN.logDialogShowEvent - NOT FOUND');
168
+ }
169
+
170
+ } catch (error) {
171
+ console.error('❌ DialogDebugger: Native method test failed:', error);
172
+ }
173
+ }
174
+
175
+ /**
176
+ * Check if dialog tracking is properly enabled
177
+ */
178
+ checkDialogTrackingStatus(): void {
179
+ console.log('🔍 DialogDebugger: Checking dialog tracking status...');
180
+
181
+ // Check DialogListener status
182
+ const dialogListener = DialogListener.getInstance();
183
+ console.log('DialogListener status:', {
184
+ isIntercepting: (dialogListener as any).isIntercepting,
185
+ eventCallbacksCount: (dialogListener as any).eventCallbacks?.length || 0
186
+ });
187
+
188
+ // Check if Alert.alert is overridden
189
+ console.log('Alert.alert override status:', {
190
+ isOverridden: Alert.alert !== this.originalAlert,
191
+ originalAlert: this.originalAlert,
192
+ currentAlert: Alert.alert
193
+ });
194
+
195
+ // Check TLTRN methods
196
+ console.log('TLTRN methods status:', {
197
+ logDialogShowEvent: typeof TLTRN.logDialogShowEvent,
198
+ interceptDialogEvents: typeof TLTRN.interceptDialogEvents
199
+ });
200
+ }
201
+
202
+ /**
203
+ * Force enable dialog tracking for testing
204
+ */
205
+ forceEnableDialogTracking(): void {
206
+ console.log('🔍 DialogDebugger: Force enabling dialog tracking...');
207
+
208
+ try {
209
+ // Force enable DialogListener
210
+ const dialogListener = DialogListener.getInstance();
211
+ (dialogListener as any).isIntercepting = true;
212
+ console.log('✅ DialogListener interception forced enabled');
213
+
214
+ // Force enable TLTRN dialog events
215
+ TLTRN.interceptDialogEvents(true);
216
+ console.log('✅ TLTRN dialog events forced enabled');
217
+
218
+ } catch (error) {
219
+ console.error('❌ DialogDebugger: Force enable failed:', error);
220
+ }
221
+ }
222
+ }
223
+
224
+ export default DialogDebugger;