react-native-acoustic-connect-beta 19.0.6 → 19.0.7

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.
@@ -115,12 +115,45 @@ Pod::Spec.new do |s|
115
115
  # Implementation (C++ objects)
116
116
  "cpp/**/*.{hpp,cpp}",
117
117
  ]
118
+ # Unit tests live in ios/Tests and belong to the UnitTests test_spec below,
119
+ # not to the library target (source_files globs ios/**/*.swift).
120
+ s.exclude_files = "ios/Tests/**"
118
121
 
119
122
  s.pod_target_xcconfig = {
120
123
  # C++ compiler flags, mainly for folly.
121
- "GCC_PREPROCESSOR_DEFINITIONS" => "$(inherited) FOLLY_NO_CONFIG FOLLY_CFG_NO_COROUTINES"
124
+ "GCC_PREPROCESSOR_DEFINITIONS" => "$(inherited) FOLLY_NO_CONFIG FOLLY_CFG_NO_COROUTINES",
125
+ # @testable import (UnitTests test_spec) needs testability in Debug.
126
+ "ENABLE_TESTABILITY[config=Debug]" => "YES"
122
127
  }
123
128
 
129
+ # Native unit tests. Run through a consumer app's Pods project:
130
+ # Podfile: pod 'AcousticConnectRN', :path => '../..', :testspecs => ['UnitTests']
131
+ # xcodebuild test -workspace <app>.xcworkspace -scheme AcousticConnectRN \
132
+ # -destination 'platform=iOS Simulator,name=<booted sim>'
133
+ # The tests use Swift Testing. They do NOT `@testable import` the pod
134
+ # module — see the source_files comment below for why that's impossible.
135
+ s.test_spec 'UnitTests' do |ts|
136
+ # The sources under test are compiled directly into the test bundle
137
+ # instead of `@testable import`ing the pod module: nitrogen's generated
138
+ # Swift compatibility header emits C++ thunks referencing nitro C++ types
139
+ # (margelo::nitro::ArrayBufferHolder) without including their headers, so
140
+ # the AcousticConnectRN clang module cannot be built by any Swift client —
141
+ # including a test target. Compiling the files here is safe: the linker
142
+ # pulls static-archive members lazily, so the parent lib's copies of
143
+ # these objects are never loaded and no duplicate symbols arise.
144
+ ts.source_files = [
145
+ 'ios/Tests/**/*.swift',
146
+ 'ios/ConnectRNParsing.swift',
147
+ 'nitrogen/generated/ios/swift/Variant_Bool_String_Double.swift',
148
+ ]
149
+ # ios/ConnectRNParsing.swift does `import Connect`. CocoaPods test_specs
150
+ # inherit the parent spec's dependencies implicitly, so this line is
151
+ # observably redundant today — declared explicitly anyway so the test
152
+ # bundle's dependency on the Connect SDK doesn't rely on that inheritance
153
+ # behavior remaining unchanged (e.g. a future migration off CocoaPods).
154
+ ts.dependency dependencyName, *dependencyRequirements
155
+ end
156
+
124
157
  s.resource_bundle = {
125
158
  'AcousticConnectRNConfig' => ['ios/AcousticConnectRNConfig.json'],
126
159
  }
package/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 19.0.7 (2026-07-03)
2
+
3
+ ### Reverts
4
+
5
+ * Revert "Beta ReactNativeConnect build: 18.0.36" ([609ad7d](https://github.com/aipoweredmarketer/react-native-acoustic-connect-beta/commit/609ad7d3244ec06f27dced5864d40585c5b3c9cf))
1
6
  ## [19.0.6](https://github.com/aipoweredmarketer/react-native-acoustic-connect-beta/compare/19.0.5...19.0.6) (2026-07-02)
2
7
  ## [19.0.5](https://github.com/aipoweredmarketer/react-native-acoustic-connect-beta/compare/19.0.4...19.0.5) (2026-07-02)
3
8
  ## [19.0.4](https://github.com/aipoweredmarketer/react-native-acoustic-connect-beta/compare/19.0.3...19.0.4) (2026-07-01)
@@ -1,4 +1,4 @@
1
- #Thu Jul 02 10:44:10 PDT 2026
1
+ #Fri Jul 03 01:59:06 PDT 2026
2
2
  UseWhiteList=true
3
3
  PrintScreen=3
4
4
  UseRandomSample=false
@@ -0,0 +1,154 @@
1
+ // Copyright (C) 2026 Acoustic, L.P. All rights reserved.
2
+ //
3
+ // NOTICE: This file contains material that is confidential and proprietary to
4
+ // Acoustic, L.P. and/or other developers. No license is granted under any intellectual or
5
+ // industrial property rights of Acoustic, L.P. except as may be provided in an agreement with
6
+ // Acoustic, L.P. Any unauthorized copying or distribution of content from this file is
7
+ // prohibited.
8
+
9
+ import Foundation
10
+ import Connect
11
+ import OSLog
12
+
13
+ // Same subsystem/category as the bridge's config logger so the extraction
14
+ // does not change where these lines surface in Console.app.
15
+ private let configLog = Logger(subsystem: "com.acoustic.AcousticConnectRN", category: "config")
16
+
17
+ /// Pure parsing / mapping / conversion logic extracted from
18
+ /// `HybridAcousticConnectRN` (behaviour-preserving extraction) so it can be
19
+ /// unit-tested without constructing the hybrid — the hybrid's `init`
20
+ /// dispatches `load()`, which enables the real SDK with the bundled AppKey.
21
+ internal enum ConnectRNParsing {
22
+
23
+ internal enum IOSPushMode: Equatable {
24
+ case automatic, manual
25
+ var descriptor: String { self == .automatic ? "automatic" : "manual" }
26
+ }
27
+
28
+ /// Lenient `PushEnabled` parser — accepts a `Bool` directly, or a string
29
+ /// like `"true"`/`"false"`/`"yes"`/`"no"`. Anything else falls back to
30
+ /// `false` with a warning so a typo in the JSON doesn't silently enable
31
+ /// push when the developer thought they'd turned it off.
32
+ static func parsePushEnabled(_ raw: Any?) -> Bool {
33
+ if let b = raw as? Bool { return b }
34
+ if let n = raw as? NSNumber { return n.boolValue }
35
+ if let s = raw as? String {
36
+ switch s.lowercased() {
37
+ case "true", "yes", "1": return true
38
+ case "false", "no", "0", "": return false
39
+ default:
40
+ configLog.warning("PushEnabled string \"\(s, privacy: .public)\" not recognised. Falling back to false.")
41
+ return false
42
+ }
43
+ }
44
+ if raw != nil {
45
+ configLog.warning("PushEnabled is set but is neither a Bool nor a recognised string. Falling back to false.")
46
+ }
47
+ return false
48
+ }
49
+
50
+ static func parseIOSPushMode(_ raw: String?) -> IOSPushMode {
51
+ switch raw?.lowercased() {
52
+ case "automatic", "auto", nil, "":
53
+ return .automatic
54
+ case "manual":
55
+ return .manual
56
+ default:
57
+ configLog.error("iOSPushMode \"\(raw ?? "", privacy: .public)\" not recognised. Allowed values: \"automatic\", \"manual\". Falling back to \"automatic\".")
58
+ return .automatic
59
+ }
60
+ }
61
+
62
+ /// Resolves `PushEnabled` + `iOSPushMode` + `iOSAppGroupIdentifier` from the
63
+ /// bundled config into a `ConnectPushConfig`. Validation errors are logged
64
+ /// at `.error`; soft mismatches at `.warning`. The SDK always falls back to
65
+ /// a safe default (`.off`) so an invalid config never crashes the app.
66
+ static func resolvePushConfig(from connectData: [String: Any]) -> ConnectPushConfig {
67
+ let pushEnabled = parsePushEnabled(connectData["PushEnabled"])
68
+ let iOSPushModeRaw = connectData["iOSPushMode"] as? String
69
+ let groupId = connectData["iOSAppGroupIdentifier"] as? String
70
+
71
+ configLog.info("PushEnabled: \(pushEnabled)")
72
+
73
+ // Inconsistency: iOSPushMode is set but PushEnabled is false. The
74
+ // mode value would never take effect; warn the developer so they
75
+ // know to fix one or the other.
76
+ if !pushEnabled, let raw = iOSPushModeRaw, !raw.isEmpty {
77
+ configLog.error("iOSPushMode \"\(raw, privacy: .public)\" is set but PushEnabled is false. Ignoring iOSPushMode; SDK will run with push disabled.")
78
+ return .off
79
+ }
80
+
81
+ guard pushEnabled else {
82
+ configLog.info("iOSPushMode: (not used, PushEnabled is false)")
83
+ configLog.info("iOSAppGroupIdentifier: (not used, PushEnabled is false)")
84
+ return .off
85
+ }
86
+
87
+ let mode = parseIOSPushMode(iOSPushModeRaw)
88
+ configLog.info("iOSPushMode: \(mode.descriptor, privacy: .public)")
89
+ if let groupId = groupId, !groupId.isEmpty {
90
+ configLog.info("iOSAppGroupIdentifier: \(groupId, privacy: .public)")
91
+ } else {
92
+ configLog.warning("iOSAppGroupIdentifier is not set. Required if your app uses a Notification Service or Notification Content extension to render rich push payloads.")
93
+ }
94
+
95
+ switch mode {
96
+ case .automatic:
97
+ return ConnectPushConfig(mode: .automatic, appGroupIdentifier: groupId)
98
+ case .manual:
99
+ return ConnectPushConfig(mode: .manual, appGroupIdentifier: groupId)
100
+ }
101
+ }
102
+
103
+ // Note: nsError(from: PushErrorInfo) stays in HybridAcousticConnectRN —
104
+ // PushErrorInfo is a C++-backed nitro type, and this file is also
105
+ // compiled into the UnitTests bundle, which builds without C++ interop.
106
+
107
+ /// Maps the JS-facing module name to the config store's module name
108
+ /// ("Connect" → "TLFCoreModule").
109
+ static func storeModuleName(for moduleName: String) -> String {
110
+ if moduleName.caseInsensitiveCompare("Connect") == .orderedSame {
111
+ return "TLFCoreModule"
112
+ }
113
+ return moduleName
114
+ }
115
+
116
+ static func convertToAnyDictionary(input: [String: Variant_Bool_String_Double]) -> [String: Any] {
117
+ var result: [String: Any] = [:]
118
+
119
+ for (key, value) in input {
120
+ switch value {
121
+ case .first(let boolValue):
122
+ result[key] = boolValue
123
+ case .second(let stringValue):
124
+ result[key] = stringValue
125
+ case .third(let doubleValue):
126
+ result[key] = doubleValue
127
+ }
128
+ }
129
+
130
+ return result
131
+ }
132
+
133
+ static func convertVariantToAny(_ variant: Variant_Bool_String_Double) -> Any {
134
+ switch variant {
135
+ case .first(let boolValue):
136
+ return boolValue
137
+ case .second(let stringValue):
138
+ return stringValue
139
+ case .third(let doubleValue):
140
+ return doubleValue
141
+ }
142
+ }
143
+
144
+ static func logLevel(from level: Double) -> kConnectMonitoringLevelType {
145
+ let intValue: Int = Int(level)
146
+ if intValue == 0 {
147
+ return kConnectMonitoringLevelType.connectMonitoringLevelIgnore
148
+ } else if intValue == 1 {
149
+ return kConnectMonitoringLevelType.connectMonitoringLevelCellularAndWiFi
150
+ } else {
151
+ return kConnectMonitoringLevelType.connectMonitoringLevelWiFi
152
+ }
153
+ }
154
+ }
@@ -143,7 +143,7 @@ class HybridAcousticConnectRN: HybridAcousticConnectRNSpec {
143
143
  configLog.info("KillSwitchUrl: \(killSwitch, privacy: .public)")
144
144
  }
145
145
 
146
- let pushConfig = self.resolvePushConfig(from: connectData)
146
+ let pushConfig = ConnectRNParsing.resolvePushConfig(from: connectData)
147
147
 
148
148
  // Non-release integrations (useRelease:false — the AcousticConnectDebug
149
149
  // SDK variant) turn on the Connect/Tealeaf/EOCore verbose native logging
@@ -174,84 +174,9 @@ class HybridAcousticConnectRN: HybridAcousticConnectRNSpec {
174
174
  bridgeLog.info("SDK initialised: appKey length=\(appKey.count), push=\(pushConfig.modeDescription, privacy: .public), isReactNative=true, wrapNavigationContainer=true")
175
175
  }
176
176
 
177
- /// Resolves `PushEnabled` + `iOSPushMode` + `iOSAppGroupIdentifier` from the
178
- /// bundled config into a `ConnectPushConfig`. Validation errors are logged
179
- /// at `.error`; soft mismatches at `.warning`. The SDK always falls back to
180
- /// a safe default (`.off`) so an invalid config never crashes the app.
181
- @MainActor
182
- private func resolvePushConfig(from connectData: [String: Any]) -> ConnectPushConfig {
183
- let pushEnabled = self.parsePushEnabled(connectData["PushEnabled"])
184
- let iOSPushModeRaw = connectData["iOSPushMode"] as? String
185
- let groupId = connectData["iOSAppGroupIdentifier"] as? String
186
-
187
- configLog.info("PushEnabled: \(pushEnabled)")
188
-
189
- // Inconsistency: iOSPushMode is set but PushEnabled is false. The
190
- // mode value would never take effect; warn the developer so they
191
- // know to fix one or the other.
192
- if !pushEnabled, let raw = iOSPushModeRaw, !raw.isEmpty {
193
- configLog.error("iOSPushMode \"\(raw, privacy: .public)\" is set but PushEnabled is false. Ignoring iOSPushMode; SDK will run with push disabled.")
194
- return .off
195
- }
196
-
197
- guard pushEnabled else {
198
- configLog.info("iOSPushMode: (not used, PushEnabled is false)")
199
- configLog.info("iOSAppGroupIdentifier: (not used, PushEnabled is false)")
200
- return .off
201
- }
202
-
203
- let mode = self.parseIOSPushMode(iOSPushModeRaw)
204
- configLog.info("iOSPushMode: \(mode.descriptor, privacy: .public)")
205
- if let groupId = groupId, !groupId.isEmpty {
206
- configLog.info("iOSAppGroupIdentifier: \(groupId, privacy: .public)")
207
- } else {
208
- configLog.warning("iOSAppGroupIdentifier is not set. Required if your app uses a Notification Service or Notification Content extension to render rich push payloads.")
209
- }
210
-
211
- switch mode {
212
- case .automatic:
213
- return ConnectPushConfig(mode: .automatic, appGroupIdentifier: groupId)
214
- case .manual:
215
- return ConnectPushConfig(mode: .manual, appGroupIdentifier: groupId)
216
- }
217
- }
218
-
219
- /// Lenient `PushEnabled` parser — accepts a `Bool` directly, or a string
220
- /// like `"true"`/`"false"`/`"yes"`/`"no"`. Anything else falls back to
221
- /// `false` with a warning so a typo in the JSON doesn't silently enable
222
- /// push when the developer thought they'd turned it off.
223
- private func parsePushEnabled(_ raw: Any?) -> Bool {
224
- if let b = raw as? Bool { return b }
225
- if let n = raw as? NSNumber { return n.boolValue }
226
- if let s = raw as? String {
227
- switch s.lowercased() {
228
- case "true", "yes", "1": return true
229
- case "false", "no", "0", "": return false
230
- default:
231
- configLog.warning("PushEnabled string \"\(s, privacy: .public)\" not recognised. Falling back to false.")
232
- return false
233
- }
234
- }
235
- if raw != nil {
236
- configLog.warning("PushEnabled is set but is neither a Bool nor a recognised string. Falling back to false.")
237
- }
238
- return false
239
- }
240
-
241
- private enum IOSPushMode { case automatic, manual
242
- var descriptor: String { self == .automatic ? "automatic" : "manual" } }
243
-
244
- private func parseIOSPushMode(_ raw: String?) -> IOSPushMode {
245
- switch raw?.lowercased() {
246
- case "automatic", "auto", nil, "":
247
- return .automatic
248
- case "manual":
249
- return .manual
250
- default:
251
- configLog.error("iOSPushMode \"\(raw ?? "", privacy: .public)\" not recognised. Allowed values: \"automatic\", \"manual\". Falling back to \"automatic\".")
252
- return .automatic
253
- }
254
- }
177
+ // Push-config resolution and the PushEnabled / iOSPushMode parsers moved
178
+ // to ConnectRNParsing (behaviour-preserving extraction) so
179
+ // they are unit-testable without constructing this hybrid.
255
180
 
256
181
  /// Reads and returns the `Connect` dictionary from the bundled
257
182
  /// `AcousticConnectRNConfig.json`. The bundle is populated at pod install
@@ -488,7 +413,10 @@ class HybridAcousticConnectRN: HybridAcousticConnectRNSpec {
488
413
  // MARK: - Push: helpers
489
414
 
490
415
  /// Builds an `NSError` from the structured bridge error object, shared by
491
- /// `pushDidFailToRegister` and `pushDidReceiveAuthorization`.
416
+ /// `pushDidFailToRegister` and `pushDidReceiveAuthorization`. Kept here
417
+ /// (not in ConnectRNParsing) because `PushErrorInfo` is a C++-backed
418
+ /// nitro type and ConnectRNParsing is also compiled into the UnitTests
419
+ /// bundle, which builds without C++ interop.
492
420
  private static func nsError(from info: PushErrorInfo) -> NSError {
493
421
  NSError(
494
422
  domain: info.domain ?? "ConnectRNBridge",
@@ -816,39 +744,18 @@ class HybridAcousticConnectRN: HybridAcousticConnectRNSpec {
816
744
  return true
817
745
  }
818
746
 
747
+ // The bodies below moved to ConnectRNParsing (behaviour-preserving
748
+ // extraction); these thin delegates keep the class API stable.
819
749
  func testModuleName(moduleName: String) throws -> String {
820
- if (moduleName.caseInsensitiveCompare("Connect") == .orderedSame) {
821
- return "TLFCoreModule"
822
- }
823
- return moduleName
750
+ return ConnectRNParsing.storeModuleName(for: moduleName)
824
751
  }
825
-
826
- func convertToAnyDictionary(input: [String: Variant_Bool_String_Double]) -> [String: Any] {
827
- var result: [String: Any] = [:]
828
-
829
- for (key, value) in input {
830
- switch value {
831
- case .first(let boolValue):
832
- result[key] = boolValue
833
- case .second(let stringValue):
834
- result[key] = stringValue
835
- case .third(let doubleValue):
836
- result[key] = doubleValue
837
- }
838
- }
839
752
 
840
- return result
753
+ func convertToAnyDictionary(input: [String: Variant_Bool_String_Double]) -> [String: Any] {
754
+ return ConnectRNParsing.convertToAnyDictionary(input: input)
841
755
  }
842
756
 
843
757
  func convertVariantToAny(_ variant: Variant_Bool_String_Double) -> Any {
844
- switch variant {
845
- case .first(let boolValue):
846
- return boolValue
847
- case .second(let stringValue):
848
- return stringValue
849
- case .third(let doubleValue):
850
- return doubleValue
851
- }
758
+ return ConnectRNParsing.convertVariantToAny(variant)
852
759
  }
853
760
 
854
761
  // func convertKeyValueMapToDictionary(_ keyValueMap: KeyValueMap) -> [AnyHashable: Any] {
@@ -863,14 +770,7 @@ class HybridAcousticConnectRN: HybridAcousticConnectRNSpec {
863
770
  // }
864
771
 
865
772
  func getLogLevelHelper(level: Double) throws -> kConnectMonitoringLevelType {
866
- let intValue: Int = Int(level)
867
- if intValue == 0 {
868
- return kConnectMonitoringLevelType.connectMonitoringLevelIgnore
869
- } else if intValue == 1 {
870
- return kConnectMonitoringLevelType.connectMonitoringLevelCellularAndWiFi
871
- } else {
872
- return kConnectMonitoringLevelType.connectMonitoringLevelWiFi
873
- }
773
+ return ConnectRNParsing.logLevel(from: level)
874
774
  }
875
775
 
876
776
  func getLogLevel(level: Double) throws -> kConnectMonitoringLevelType {
package/package.json CHANGED
@@ -84,6 +84,7 @@
84
84
  "ios/**/*.mm",
85
85
  "ios/**/*.cpp",
86
86
  "ios/**/*.swift",
87
+ "!ios/Tests/**",
87
88
  "ios/AcousticConnectRNConfig.json",
88
89
  "app.plugin.js",
89
90
  "plugin/build",
@@ -226,7 +227,7 @@
226
227
  "source": "src/index",
227
228
  "summary": "react-native ios android tealeaf connect cxa wxca er enhanced-replay",
228
229
  "types": "./lib/typescript/src/index.d.ts",
229
- "version": "19.0.6",
230
+ "version": "19.0.7",
230
231
  "workspaces": [
231
232
  "example",
232
233
  "Examples/bare-workflow"