react-native-acoustic-connect-beta 18.0.11 → 18.0.13
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/Examples/SampleUI/src/index.native.tsx +46 -31
- package/README.md +4 -0
- package/android/src/main/assets/ConnectAdvancedConfig.json +1 -1
- package/android/src/main/assets/TealeafAdvancedConfig.json +1 -1
- package/lib/commonjs/TLTRN.js +219 -0
- package/lib/commonjs/TLTRN.js.map +1 -0
- package/lib/commonjs/components/Connect.js +105 -0
- package/lib/commonjs/components/Connect.js.map +1 -0
- package/lib/commonjs/components/ConnectProfiler.js +45 -0
- package/lib/commonjs/components/ConnectProfiler.js.map +1 -0
- package/lib/commonjs/index.js +22 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/utils/KeyboardListener.js +110 -0
- package/lib/commonjs/utils/KeyboardListener.js.map +1 -0
- package/lib/module/TLTRN.js +214 -0
- package/lib/module/TLTRN.js.map +1 -0
- package/lib/module/components/Connect.js +98 -0
- package/lib/module/components/Connect.js.map +1 -0
- package/lib/module/components/ConnectProfiler.js +40 -0
- package/lib/module/components/ConnectProfiler.js.map +1 -0
- package/lib/module/index.js +4 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils/KeyboardListener.js +105 -0
- package/lib/module/utils/KeyboardListener.js.map +1 -0
- package/lib/typescript/src/TLTRN.d.ts +47 -0
- package/lib/typescript/src/TLTRN.d.ts.map +1 -0
- package/lib/typescript/src/components/Connect.d.ts +18 -0
- package/lib/typescript/src/components/Connect.d.ts.map +1 -0
- package/lib/typescript/src/components/ConnectProfiler.d.ts +23 -0
- package/lib/typescript/src/components/ConnectProfiler.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +4 -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/{jslib/components/ConnectProfiler.js → lib/typescript/src/utils/KeyboardListener.d.ts} +9 -29
- package/lib/typescript/src/utils/KeyboardListener.d.ts.map +1 -0
- package/package.json +1 -2
- package/scripts/ConnectConfig.json +1 -1
- package/scripts/javaParser.js +1 -1
- package/{jslib/TLTRN.js → src/TLTRN.ts} +54 -39
- package/src/components/Connect.tsx +126 -0
- package/src/components/ConnectProfiler.ts +43 -0
- package/src/index.ts +5 -3
- package/src/specs/react-native-acoustic-connect.nitro.ts +1 -15
- package/src/utils/KeyboardListener.ts +113 -0
- package/Examples/SampleUI/package-lock.json +0 -17033
- package/jslib/components/Connect.js +0 -85
- package/jslib/utils/KeyboardListener.js +0 -100
- 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/TLTRN.d.ts +0 -37
- package/lib/typescript/jslib/TLTRN.d.ts.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/jslib/components/ConnectProfiler.d.ts +0 -10
- package/lib/typescript/jslib/components/ConnectProfiler.d.ts.map +0 -1
- package/lib/typescript/jslib/utils/KeyboardListener.d.ts +0 -10
- package/lib/typescript/jslib/utils/KeyboardListener.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
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Connect": {
|
|
3
|
+
"AndroidVersion": "10.4.30",
|
|
4
|
+
"AppKey": "b6c3709b7a4c479bb4b5a9fb8fec324c",
|
|
5
|
+
"KillSwitchUrl": "https://lib-us-2.brilliantcollector.com/collector/switch/b6c3709b7a4c479bb4b5a9fb8fec324c",
|
|
6
|
+
"PostMessageUrl": "https://lib-us-2.brilliantcollector.com/collector/collectorPost",
|
|
7
|
+
"iOSVersion": "",
|
|
8
|
+
"layoutConfigAndroid": {
|
|
9
|
+
"AppendMapIds": {
|
|
10
|
+
"[w,9290],[v,0]": {
|
|
11
|
+
"mid": "ASimpleUIView"
|
|
12
|
+
},
|
|
13
|
+
"idxPathValue": {
|
|
14
|
+
"mid": "giveAdditionalId2"
|
|
15
|
+
},
|
|
16
|
+
"tag2999999": {
|
|
17
|
+
"mid": "giveAdditionalId1"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"AutoLayout": {
|
|
21
|
+
"ExampleMaskingPage": {
|
|
22
|
+
"CaptureLayoutDelay": 0,
|
|
23
|
+
"CaptureLayoutOn": 0,
|
|
24
|
+
"CaptureScreenVisits": false,
|
|
25
|
+
"CaptureScreenshotOn": 0,
|
|
26
|
+
"CaptureUserEvents": false,
|
|
27
|
+
"DisplayName": "",
|
|
28
|
+
"Masking": {
|
|
29
|
+
"HasCustomMask": true,
|
|
30
|
+
"HasMasking": true,
|
|
31
|
+
"MaskAccessibilityIdList": [
|
|
32
|
+
|
|
33
|
+
],
|
|
34
|
+
"MaskAccessibilityLabelList": [
|
|
35
|
+
|
|
36
|
+
],
|
|
37
|
+
"MaskIdList": [
|
|
38
|
+
"^9[0-9][0-9][0-9]$",
|
|
39
|
+
"^\\[wvv,0\\],\\[dddv,0\\],\\[v,0\\],\\[v,0\\],\\[v,0\\],\\[b,0\\](.)*$"
|
|
40
|
+
],
|
|
41
|
+
"MaskValueList": [
|
|
42
|
+
"^4[0-9]{12}(?:[0-9]{3})?$",
|
|
43
|
+
"^3[47][0-9]{13}$",
|
|
44
|
+
"^65[4-9][0-9]{13}|64[4-9][0-9]{13}|6011[0-9]{12}|(622(?:12[6-9]|1[3-9][0-9]|[2-8][0-9][0-9]|9[01][0-9]|92[0-5])[0-9]{10})$",
|
|
45
|
+
"^(5[1-5][0-9]{14}|2(22[1-9][0-9]{12}|2[3-9][0-9]{13}|[3-6][0-9]{14}|7[0-1][0-9]{13}|720[0-9]{12}))$"
|
|
46
|
+
],
|
|
47
|
+
"Sensitive": {
|
|
48
|
+
"capitalCaseAlphabet": "X",
|
|
49
|
+
"number": "9",
|
|
50
|
+
"smallCaseAlphabet": "x",
|
|
51
|
+
"symbol": "#"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"NumberOfWebViews": 0,
|
|
55
|
+
"ScreenChange": false,
|
|
56
|
+
"ScreenShot": false
|
|
57
|
+
},
|
|
58
|
+
"GlobalScreenSettings": {
|
|
59
|
+
"CaptureLayoutDelay": 1,
|
|
60
|
+
"CaptureLayoutOn": 2,
|
|
61
|
+
"CaptureScreenVisits": false,
|
|
62
|
+
"CaptureScreenshotOn": 2,
|
|
63
|
+
"CaptureUserEvents": true,
|
|
64
|
+
"DisplayName": "",
|
|
65
|
+
"Masking": {
|
|
66
|
+
"HasCustomMask": true,
|
|
67
|
+
"HasMasking": true,
|
|
68
|
+
"MaskAccessibilityIdList": [
|
|
69
|
+
|
|
70
|
+
],
|
|
71
|
+
"MaskAccessibilityLabelList": [
|
|
72
|
+
|
|
73
|
+
],
|
|
74
|
+
"MaskIdList": [
|
|
75
|
+
|
|
76
|
+
],
|
|
77
|
+
"MaskValueList": [
|
|
78
|
+
|
|
79
|
+
],
|
|
80
|
+
"Sensitive": {
|
|
81
|
+
"capitalCaseAlphabet": "X",
|
|
82
|
+
"number": "9",
|
|
83
|
+
"smallCaseAlphabet": "x",
|
|
84
|
+
"symbol": "#"
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"NumberOfWebViews": 0,
|
|
88
|
+
"ScreenChange": true,
|
|
89
|
+
"ScreenShot": true
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"layoutConfigIos": {
|
|
94
|
+
"AppendMapIds": {
|
|
95
|
+
"[w,9290],[v,0]": {
|
|
96
|
+
"mid": "ASimpleUIView"
|
|
97
|
+
},
|
|
98
|
+
"idxPathValue": {
|
|
99
|
+
"mid": "giveAdditionalId2"
|
|
100
|
+
},
|
|
101
|
+
"tag2999999": {
|
|
102
|
+
"mid": "giveAdditionalId1"
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"AutoLayout": {
|
|
106
|
+
"ExampleMaskingPage": {
|
|
107
|
+
"CaptureLayoutDelay": 0,
|
|
108
|
+
"CaptureLayoutOn": 0,
|
|
109
|
+
"CaptureScreenVisits": false,
|
|
110
|
+
"CaptureScreenshotOn": 0,
|
|
111
|
+
"CaptureUserEvents": false,
|
|
112
|
+
"DisplayName": "",
|
|
113
|
+
"Masking": {
|
|
114
|
+
"HasCustomMask": true,
|
|
115
|
+
"HasMasking": true,
|
|
116
|
+
"MaskAccessibilityIdList": [
|
|
117
|
+
|
|
118
|
+
],
|
|
119
|
+
"MaskAccessibilityLabelList": [
|
|
120
|
+
|
|
121
|
+
],
|
|
122
|
+
"MaskIdList": [
|
|
123
|
+
"^9[0-9][0-9][0-9]$",
|
|
124
|
+
"^\\[wvv,0\\],\\[dddv,0\\],\\[v,0\\],\\[v,0\\],\\[v,0\\],\\[b,0\\](.)*$"
|
|
125
|
+
],
|
|
126
|
+
"MaskValueList": [
|
|
127
|
+
"^4[0-9]{12}(?:[0-9]{3})?$",
|
|
128
|
+
"^3[47][0-9]{13}$",
|
|
129
|
+
"^65[4-9][0-9]{13}|64[4-9][0-9]{13}|6011[0-9]{12}|(622(?:12[6-9]|1[3-9][0-9]|[2-8][0-9][0-9]|9[01][0-9]|92[0-5])[0-9]{10})$",
|
|
130
|
+
"^(5[1-5][0-9]{14}|2(22[1-9][0-9]{12}|2[3-9][0-9]{13}|[3-6][0-9]{14}|7[0-1][0-9]{13}|720[0-9]{12}))$"
|
|
131
|
+
],
|
|
132
|
+
"Sensitive": {
|
|
133
|
+
"capitalCaseAlphabet": "X",
|
|
134
|
+
"number": "9",
|
|
135
|
+
"smallCaseAlphabet": "x",
|
|
136
|
+
"symbol": "#"
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
"NumberOfWebViews": 0,
|
|
140
|
+
"ScreenChange": false,
|
|
141
|
+
"ScreenShot": false
|
|
142
|
+
},
|
|
143
|
+
"GlobalScreenSettings": {
|
|
144
|
+
"CaptureLayoutDelay": 1,
|
|
145
|
+
"CaptureLayoutOn": 2,
|
|
146
|
+
"CaptureScreenVisits": false,
|
|
147
|
+
"CaptureScreenshotOn": 2,
|
|
148
|
+
"CaptureUserEvents": true,
|
|
149
|
+
"DisplayName": "",
|
|
150
|
+
"Masking": {
|
|
151
|
+
"HasCustomMask": true,
|
|
152
|
+
"HasMasking": true,
|
|
153
|
+
"MaskAccessibilityIdList": [
|
|
154
|
+
|
|
155
|
+
],
|
|
156
|
+
"MaskAccessibilityLabelList": [
|
|
157
|
+
|
|
158
|
+
],
|
|
159
|
+
"MaskIdList": [
|
|
160
|
+
|
|
161
|
+
],
|
|
162
|
+
"MaskValueList": [
|
|
163
|
+
|
|
164
|
+
],
|
|
165
|
+
"Sensitive": {
|
|
166
|
+
"capitalCaseAlphabet": "X",
|
|
167
|
+
"number": "9",
|
|
168
|
+
"smallCaseAlphabet": "x",
|
|
169
|
+
"symbol": "#"
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
"NumberOfWebViews": 0,
|
|
173
|
+
"ScreenChange": true,
|
|
174
|
+
"ScreenShot": true
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
"useRelease": false
|
|
179
|
+
}
|
|
180
|
+
}
|
|
@@ -1,22 +1,27 @@
|
|
|
1
1
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
2
|
+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
|
3
|
+
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
|
4
|
+
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
|
2
5
|
|
|
3
6
|
<uses-permission android:name="android.permission.INTERNET" />
|
|
4
7
|
|
|
5
8
|
<application
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
android:name=".MainApplication"
|
|
10
|
+
android:label="@string/app_name"
|
|
11
|
+
android:icon="@mipmap/ic_launcher"
|
|
12
|
+
android:roundIcon="@mipmap/ic_launcher_round"
|
|
13
|
+
android:allowBackup="false"
|
|
14
|
+
android:theme="@style/AppTheme"
|
|
15
|
+
android:supportsRtl="true"
|
|
16
|
+
>
|
|
13
17
|
<activity
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
android:name=".MainActivity"
|
|
19
|
+
android:label="@string/app_name"
|
|
20
|
+
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
|
|
21
|
+
android:launchMode="singleTask"
|
|
22
|
+
android:windowSoftInputMode="adjustResize"
|
|
23
|
+
android:exported="true"
|
|
24
|
+
>
|
|
20
25
|
<intent-filter>
|
|
21
26
|
<action android:name="android.intent.action.MAIN" />
|
|
22
27
|
<category android:name="android.intent.category.LAUNCHER" />
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
package com.sampleui
|
|
2
|
+
import com.acoustic.connect.android.connectmod.Connect
|
|
3
|
+
import android.view.MotionEvent
|
|
2
4
|
import expo.modules.ReactActivityDelegateWrapper
|
|
3
5
|
|
|
4
6
|
import com.facebook.react.ReactActivity
|
|
@@ -8,16 +10,56 @@ import com.facebook.react.defaults.DefaultReactActivityDelegate
|
|
|
8
10
|
|
|
9
11
|
class MainActivity : ReactActivity() {
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
/**
|
|
12
14
|
* Returns the name of the main component registered from JavaScript. This is used to schedule
|
|
13
15
|
* rendering of the component.
|
|
14
16
|
*/
|
|
15
|
-
|
|
17
|
+
override fun getMainComponentName(): String = "SampleUI"
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
/**
|
|
18
20
|
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
|
|
19
21
|
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
|
|
20
22
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
override fun createReactActivityDelegate(): ReactActivityDelegate = ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled))
|
|
24
|
+
|
|
25
|
+
override fun dispatchTouchEvent(e: MotionEvent?): Boolean {
|
|
26
|
+
Connect.dispatchTouchEvent(this, e)
|
|
27
|
+
return super.dispatchTouchEvent(e)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
override fun dispatchTouchEvent(e: MotionEvent?): Boolean {
|
|
31
|
+
Connect.dispatchTouchEvent(this, e)
|
|
32
|
+
return super.dispatchTouchEvent(e)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
override fun dispatchTouchEvent(e: MotionEvent?): Boolean {
|
|
36
|
+
Connect.dispatchTouchEvent(this, e)
|
|
37
|
+
return super.dispatchTouchEvent(e)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
override fun dispatchTouchEvent(e: MotionEvent?): Boolean {
|
|
41
|
+
Connect.dispatchTouchEvent(this, e)
|
|
42
|
+
return super.dispatchTouchEvent(e)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
override fun dispatchTouchEvent(e: MotionEvent?): Boolean {
|
|
46
|
+
Connect.dispatchTouchEvent(this, e)
|
|
47
|
+
return super.dispatchTouchEvent(e)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
override fun dispatchTouchEvent(e: MotionEvent?): Boolean {
|
|
51
|
+
Connect.dispatchTouchEvent(this, e)
|
|
52
|
+
return super.dispatchTouchEvent(e)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
override fun dispatchTouchEvent(e: MotionEvent?): Boolean {
|
|
56
|
+
Connect.dispatchTouchEvent(this, e)
|
|
57
|
+
return super.dispatchTouchEvent(e)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
override fun dispatchTouchEvent(e: MotionEvent?): Boolean {
|
|
61
|
+
Connect.dispatchTouchEvent(this, e)
|
|
62
|
+
return super.dispatchTouchEvent(e)
|
|
63
|
+
}
|
|
23
64
|
}
|
|
65
|
+
|
|
@@ -60,6 +60,23 @@
|
|
|
60
60
|
ReferencedContainer = "container:SampleUI.xcodeproj">
|
|
61
61
|
</BuildableReference>
|
|
62
62
|
</BuildableProductRunnable>
|
|
63
|
+
<EnvironmentVariables>
|
|
64
|
+
<EnvironmentVariable
|
|
65
|
+
key = "EODebug"
|
|
66
|
+
value = "1"
|
|
67
|
+
isEnabled = "YES">
|
|
68
|
+
</EnvironmentVariable>
|
|
69
|
+
<EnvironmentVariable
|
|
70
|
+
key = "TLF_DEBUG"
|
|
71
|
+
value = "1"
|
|
72
|
+
isEnabled = "YES">
|
|
73
|
+
</EnvironmentVariable>
|
|
74
|
+
<EnvironmentVariable
|
|
75
|
+
key = "CONNECT_DEBUG"
|
|
76
|
+
value = "1"
|
|
77
|
+
isEnabled = "YES">
|
|
78
|
+
</EnvironmentVariable>
|
|
79
|
+
</EnvironmentVariables>
|
|
63
80
|
</LaunchAction>
|
|
64
81
|
<ProfileAction
|
|
65
82
|
buildConfiguration = "Release"
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
"ios": "cd ios && pod install && cd .. && react-native run-ios",
|
|
8
8
|
"lint": "eslint .",
|
|
9
9
|
"start": "react-native start",
|
|
10
|
-
"test": "jest"
|
|
10
|
+
"test": "jest",
|
|
11
|
+
"updateYalc": "yalc update react-native-acoustic-connect-beta && cd ios && pod install && cd .."
|
|
11
12
|
},
|
|
12
13
|
"dependencies": {
|
|
13
14
|
"@babel/plugin-proposal-export-namespace-from": "^7.18.9",
|
|
@@ -25,7 +26,7 @@
|
|
|
25
26
|
"expo-status-bar": "^2.0.1",
|
|
26
27
|
"react": "18.3.1",
|
|
27
28
|
"react-native": "0.76.9",
|
|
28
|
-
"react-native-acoustic-connect-beta": "
|
|
29
|
+
"react-native-acoustic-connect-beta": "file:.yalc/react-native-acoustic-connect-beta",
|
|
29
30
|
"react-native-gesture-handler": "~2.20.2",
|
|
30
31
|
"react-native-get-random-values": "^1.11.0",
|
|
31
32
|
"react-native-nitro-modules": "^0.25.2",
|
|
@@ -11,6 +11,15 @@ import { Appbar } from 'react-native-paper';
|
|
|
11
11
|
|
|
12
12
|
import ExampleList, { examples } from './ExampleList';
|
|
13
13
|
|
|
14
|
+
// import { AcousticConnectRN, Connect } from 'react-native-acoustic-connect-beta';
|
|
15
|
+
// Log all exported items from the module
|
|
16
|
+
import AcousticConnectRN from 'react-native-acoustic-connect-beta';
|
|
17
|
+
import * as AcousticConnectBeta from 'react-native-acoustic-connect-beta';
|
|
18
|
+
console.log('RootNavigator.tsx:Exported items from react-native-acoustic-connect-beta:', AcousticConnectBeta);
|
|
19
|
+
|
|
20
|
+
const result = AcousticConnectRN.logCustomEvent('test', {test: 'test'}, 1);
|
|
21
|
+
console.log('result', result);
|
|
22
|
+
|
|
14
23
|
const Stack = createStackNavigator();
|
|
15
24
|
|
|
16
25
|
export default function Root() {
|
|
@@ -53,7 +62,7 @@ export default function Root() {
|
|
|
53
62
|
name="ExampleList"
|
|
54
63
|
component={ExampleList}
|
|
55
64
|
options={{
|
|
56
|
-
title: 'Examples',
|
|
65
|
+
title: 'Examples: Acoustic Connect',
|
|
57
66
|
}}
|
|
58
67
|
/>
|
|
59
68
|
{(Object.keys(examples) as Array<keyof typeof examples>).map((id) => {
|
|
@@ -32,6 +32,12 @@ import DrawerItems from './DrawerItems';
|
|
|
32
32
|
import App from './RootNavigator';
|
|
33
33
|
import { deviceColorsSupported } from '../utils';
|
|
34
34
|
|
|
35
|
+
import * as AcousticConnectBeta from 'react-native-acoustic-connect-beta';
|
|
36
|
+
console.log('index.native.tsx:Exported items from react-native-acoustic-connect-beta:', AcousticConnectBeta);
|
|
37
|
+
import { NavigationContainerRef } from '@react-navigation/native';
|
|
38
|
+
import { useRef } from 'react';
|
|
39
|
+
|
|
40
|
+
|
|
35
41
|
const PERSISTENCE_KEY = 'NAVIGATION_STATE';
|
|
36
42
|
const PREFERENCES_KEY = 'APP_PREFERENCES';
|
|
37
43
|
|
|
@@ -58,6 +64,9 @@ const Drawer = createDrawerNavigator<{ Home: undefined }>();
|
|
|
58
64
|
export default function PaperExample() {
|
|
59
65
|
useKeepAwake();
|
|
60
66
|
|
|
67
|
+
// Add for Acoustic Connect SDK
|
|
68
|
+
const navigationRef = useRef<NavigationContainerRef>(null);
|
|
69
|
+
|
|
61
70
|
const [fontsLoaded] = useFonts({
|
|
62
71
|
Abel: require('../assets/fonts/Abel-Regular.ttf'),
|
|
63
72
|
});
|
|
@@ -232,37 +241,43 @@ export default function PaperExample() {
|
|
|
232
241
|
>
|
|
233
242
|
<PreferencesContext.Provider value={preferences}>
|
|
234
243
|
<React.Fragment>
|
|
235
|
-
<
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
{(
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
244
|
+
<AcousticConnectBeta.Connect
|
|
245
|
+
captureKeyboardEvents={true}
|
|
246
|
+
navigationRef={navigationRef} // Pass the ref to Connect
|
|
247
|
+
>
|
|
248
|
+
<NavigationContainer
|
|
249
|
+
ref={navigationRef} // Pass the same ref to NavigationContainer
|
|
250
|
+
theme={combinedTheme}
|
|
251
|
+
initialState={initialState}
|
|
252
|
+
onStateChange={(state) =>
|
|
253
|
+
AsyncStorage.setItem(PERSISTENCE_KEY, JSON.stringify(state))
|
|
254
|
+
}
|
|
255
|
+
>
|
|
256
|
+
<SafeAreaInsetsContext.Consumer>
|
|
257
|
+
{(insets) => {
|
|
258
|
+
const { left, right } = insets || { left: 0, right: 0 };
|
|
259
|
+
const collapsedDrawerWidth = 80 + Math.max(left, right);
|
|
260
|
+
return (
|
|
261
|
+
<Drawer.Navigator
|
|
262
|
+
screenOptions={{
|
|
263
|
+
drawerStyle: collapsed && {
|
|
264
|
+
width: collapsedDrawerWidth,
|
|
265
|
+
},
|
|
266
|
+
}}
|
|
267
|
+
drawerContent={() => <DrawerItems />}
|
|
268
|
+
>
|
|
269
|
+
<Drawer.Screen
|
|
270
|
+
name="Home"
|
|
271
|
+
component={App}
|
|
272
|
+
options={{ headerShown: false }}
|
|
273
|
+
/>
|
|
274
|
+
</Drawer.Navigator>
|
|
275
|
+
);
|
|
276
|
+
}}
|
|
277
|
+
</SafeAreaInsetsContext.Consumer>
|
|
278
|
+
<StatusBar style={!theme.isV3 || theme.dark ? 'light' : 'dark'} />
|
|
279
|
+
</NavigationContainer>
|
|
280
|
+
</AcousticConnectBeta.Connect>
|
|
266
281
|
</React.Fragment>
|
|
267
282
|
</PreferencesContext.Provider>
|
|
268
283
|
</PaperProvider>
|
package/README.md
CHANGED
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
## Installation
|
|
9
9
|
|
|
10
10
|
```bash
|
|
11
|
+
// To add to your package
|
|
11
12
|
npm add react-native-acoustic-connect-beta react-native-nitro-modules
|
|
13
|
+
// To install on your application and view debug information during install
|
|
14
|
+
npm install --foreground-scripts --force
|
|
15
|
+
|
|
12
16
|
```
|
|
13
17
|
|
|
14
18
|
|