react-native-acoustic-connect-beta 19.0.14 → 19.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 (37) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/ConnectConfig.example.json +1 -1
  3. package/Examples/SampleUI/ConnectConfig.json +2 -2
  4. package/README.md +164 -1
  5. package/android/build.gradle +64 -0
  6. package/android/config.gradle +123 -12
  7. package/android/src/main/assets/ConnectAdvancedConfig.json +1 -1
  8. package/android/src/main/assets/ConnectBasicConfig.properties +1 -1
  9. package/android/src/main/java/com/acousticconnectrn/HybridAcousticConnectRN.kt +210 -20
  10. package/ios/ConnectRNParsing.swift +229 -0
  11. package/ios/HybridAcousticConnectRN.swift +125 -27
  12. package/lib/commonjs/TLTRN.js +26 -3
  13. package/lib/commonjs/TLTRN.js.map +1 -1
  14. package/lib/commonjs/index.js +3 -0
  15. package/lib/commonjs/index.js.map +1 -1
  16. package/lib/module/TLTRN.js +26 -3
  17. package/lib/module/TLTRN.js.map +1 -1
  18. package/lib/module/index.js +5 -0
  19. package/lib/module/index.js.map +1 -1
  20. package/lib/typescript/src/TLTRN.d.ts +22 -1
  21. package/lib/typescript/src/TLTRN.d.ts.map +1 -1
  22. package/lib/typescript/src/index.d.ts +1 -0
  23. package/lib/typescript/src/index.d.ts.map +1 -1
  24. package/lib/typescript/src/specs/react-native-acoustic-connect.nitro.d.ts +150 -10
  25. package/lib/typescript/src/specs/react-native-acoustic-connect.nitro.d.ts.map +1 -1
  26. package/nitrogen/generated/android/c++/JHybridAcousticConnectRNSpec.cpp +5 -9
  27. package/nitrogen/generated/android/c++/JHybridAcousticConnectRNSpec.hpp +1 -1
  28. package/nitrogen/generated/android/kotlin/com/margelo/nitro/acousticconnectrn/HybridAcousticConnectRNSpec.kt +2 -1
  29. package/nitrogen/generated/ios/AcousticConnectRN-Swift-Cxx-Umbrella.hpp +1 -0
  30. package/nitrogen/generated/ios/c++/HybridAcousticConnectRNSpecSwift.hpp +2 -1
  31. package/nitrogen/generated/ios/swift/HybridAcousticConnectRNSpec.swift +1 -1
  32. package/nitrogen/generated/ios/swift/HybridAcousticConnectRNSpec_cxx.swift +2 -25
  33. package/nitrogen/generated/shared/c++/HybridAcousticConnectRNSpec.hpp +2 -1
  34. package/package.json +2 -1
  35. package/src/TLTRN.ts +31 -3
  36. package/src/index.ts +5 -0
  37. package/src/specs/react-native-acoustic-connect.nitro.ts +152 -10
@@ -1,8 +1,33 @@
1
- import { type HybridObject } from 'react-native-nitro-modules';
1
+ import { type AnyMap, type HybridObject } from 'react-native-nitro-modules';
2
2
  export type KeyValueObject = {
3
3
  placeholder: string;
4
4
  [key: string]: unknown;
5
5
  };
6
+ /**
7
+ * Payload accepted by {@link AcousticConnectRN.logSignal} — any JSON-shaped
8
+ * object. Nested objects and arrays are allowed, so this is a superset of a
9
+ * flat `Record<string, string | number | boolean>`.
10
+ *
11
+ * You do not need this type to call `logSignal`: an object literal is enough.
12
+ * It exists for the times you want to name the payload — a helper parameter, a
13
+ * shared constant — and is re-exported from the package root so you never have
14
+ * to reach into `react-native-nitro-modules` for it:
15
+ *
16
+ * ```ts
17
+ * import AcousticConnectRN, { type SignalValues } from 'react-native-acoustic-connect-beta'
18
+ *
19
+ * const payload: SignalValues = { signalContent: { signalType: 'pageview' } }
20
+ * AcousticConnectRN.logSignal(payload, 1)
21
+ * ```
22
+ *
23
+ * @remarks
24
+ * Aliases nitro's `AnyMap`, which is the only way to express arbitrary JSON in
25
+ * a Nitro spec — a hand-rolled recursive type is rejected by nitrogen, which
26
+ * tries to generate a struct for it. Nitrogen resolves the alias, so the
27
+ * generated native bindings are identical either way; the indirection exists
28
+ * purely to keep a third-party type name off our public API.
29
+ */
30
+ export type SignalValues = AnyMap;
6
31
  export type ConnectMonitoringLevelType = 'Ignore' | 'CellularAndWiFi' | 'WiFi';
7
32
  /**
8
33
  * Structured error describing an APNs / permission failure.
@@ -107,8 +132,74 @@ export interface AcousticConnectRN extends HybridObject<{
107
132
  getBooleanConfigItemForKey(theDefault: boolean, key: string, moduleName: string): boolean;
108
133
  getStringItemForKey(theDefault: string, key: string, moduleName: string): string | null | undefined;
109
134
  getNumberItemForKey(theDefault: number, key: string, moduleName: string): number;
135
+ /**
136
+ * Logs a named custom event with a flat set of key/value pairs.
137
+ *
138
+ * `values` is deliberately **flat** (scalars only), unlike
139
+ * {@link logSignal}. The Android SDK's custom-event path is typed
140
+ * `HashMap<String, String>` end to end (`Connect.logCustomEvent` →
141
+ * `Tealeaf.logCustomEvent`), so there is no native route for nested
142
+ * JSON. Widening this signature would compile but silently drop the
143
+ * nesting on Android while preserving it on iOS — a cross-platform
144
+ * divergence worse than the restriction. Use {@link logSignal} when the
145
+ * payload needs structure.
146
+ *
147
+ * @param eventName Event name; appears in the posted JSON.
148
+ * @param values Flat key/value pairs to attach to the event.
149
+ * @param level Monitoring level for this event.
150
+ * @returns `true` if the event was queued.
151
+ */
110
152
  logCustomEvent(eventName: string, values: Record<string, string | number | boolean>, level: number): boolean;
111
- logSignal(values: Record<string, string | number | boolean>, level: number): boolean;
153
+ /**
154
+ * Logs a signal payload.
155
+ *
156
+ * `values` accepts **arbitrary JSON** — nested objects and arrays, not
157
+ * just scalars — because both native SDKs embed the payload verbatim:
158
+ * iOS `CTSignalMessage` gates only on `NSJSONSerialization
159
+ * isValidJSONObject:`, and Android `Connect.logSignal` takes an untyped
160
+ * `HashMap<String, Any?>`. The bridge converts the map to each
161
+ * platform's JSON representation without flattening or reshaping it.
162
+ *
163
+ * Scalar-only callers are unaffected: {@link SignalValues} is a superset
164
+ * of `Record<string, string | number | boolean>`.
165
+ *
166
+ * @param values Signal payload. Objects, arrays, strings, numbers,
167
+ * booleans and `null` are all carried through.
168
+ * @param level Monitoring level for this signal.
169
+ * @returns `true` if the signal was queued.
170
+ *
171
+ * @remarks
172
+ * **Android limitation — top-level numbers.** The Android SDK's
173
+ * `JsonUtil.getHashValues` serialises only `String`, `Boolean`,
174
+ * `JSONObject`, `JSONArray` and `byte[]` at the top level of the signal
175
+ * map; a top-level numeric value is dropped. Numbers nested *inside* an
176
+ * object or array are unaffected, because the bridge builds those
177
+ * `JSONObject`/`JSONArray` values itself. iOS carries top-level numbers
178
+ * normally. Send numbers inside a nested object when cross-platform
179
+ * parity matters. This is a pre-existing SDK-side gap, not a
180
+ * restriction of this bridge.
181
+ *
182
+ * @example Nested payload
183
+ * ```ts
184
+ * import AcousticConnectRN from 'react-native-acoustic-connect-beta'
185
+ *
186
+ * AcousticConnectRN.logSignal(
187
+ * {
188
+ * signalContent: {
189
+ * signalType: 'pageview',
190
+ * url: 'https://app.example.com/dashboard',
191
+ * pageCategory: 'dashboard',
192
+ * },
193
+ * audience: [
194
+ * { name: 'Account Name', value: 'Acme Corp' },
195
+ * { name: 'Account ID', value: '4815162342' },
196
+ * ],
197
+ * },
198
+ * 1
199
+ * )
200
+ * ```
201
+ */
202
+ logSignal(values: SignalValues, level: number): boolean;
112
203
  logExceptionEvent(message: string, stackInfo: string, unhandled: boolean): boolean;
113
204
  logLocation(): boolean;
114
205
  logLocationWithLatitudeLongitude(latitude: number, longitude: number, level: number): boolean;
@@ -117,10 +208,28 @@ export interface AcousticConnectRN extends HybridObject<{
117
208
  setCurrentScreenName(logicalPageName: string): boolean;
118
209
  logScreenViewContextLoad(logicalPageName: string | null | undefined, referrer: string | null | undefined): boolean;
119
210
  logScreenViewContextUnload(logicalPageName: string | null | undefined, referrer: string | null | undefined): boolean;
211
+ /**
212
+ * Captures the layout of the current screen.
213
+ *
214
+ * @param name Screen name to associate with the capture.
215
+ * @param delay Milliseconds to wait before capturing — the same unit as
216
+ * `CaptureLayoutDelay` in the layout config, on both platforms. A
217
+ * negative value means "use the `CaptureLayoutDelay` configured for this
218
+ * screen"; `0` captures immediately.
219
+ *
220
+ * Prefer `TLTRN.logScreenLayout`, which defaults to the configured delay.
221
+ */
120
222
  logScreenLayout(name: string, delay: number): boolean;
121
223
  logDialogShowEvent(dialogId: string, dialogTitle: string, dialogType: string): boolean;
122
224
  logDialogDismissEvent(dialogId: string, dismissReason: string): boolean;
123
225
  logDialogButtonClickEvent(dialogId: string, buttonText: string, buttonIndex: number): boolean;
226
+ /**
227
+ * Logs a custom event against a tracked dialog.
228
+ *
229
+ * `values` is flat for the same reason as {@link logCustomEvent} — this
230
+ * routes to the native custom-event API, whose Android path carries string
231
+ * values only.
232
+ */
124
233
  logDialogCustomEvent(dialogId: string, eventName: string, values: Record<string, string | number | boolean>): boolean;
125
234
  /**
126
235
  * Logs a user identity so the current device/session can be associated with
@@ -143,23 +252,54 @@ export interface AcousticConnectRN extends HybridObject<{
143
252
  * `'loggedIn'` when omitted (identity logging typically marks a sign-in),
144
253
  * overriding the native SDKs' own `'pageView'` default.
145
254
  * @param additionalParameters Optional extra key/value pairs merged into the
146
- * signal payload. Only when omitted (`undefined`) does the bridge supply
147
- * the default `{ registrationMethod: 'email' }`; an explicitly-provided
148
- * map is used as-is, so passing an empty `{}` sends no extra parameters
149
- * (the default is not merged in). A `'url'` entry is honoured uniformly on
150
- * both platforms: on Android it is routed to the SDK's explicit `url`
151
- * parameter, on iOS it rides inside the parameter map (where the native
152
- * API expects it).
255
+ * signal payload. Only when omitted (`undefined`) does the bridge supply a
256
+ * default, and that default follows the resolved `signalType` — see
257
+ * **Required method attribute** below. An explicitly-provided map is used
258
+ * as-is, so passing an empty `{}` sends no extra parameters (the default is
259
+ * not merged in). A `'url'` entry is honoured uniformly on both platforms:
260
+ * on Android it is routed to the SDK's explicit `url` parameter, on iOS it
261
+ * rides inside the parameter map (where the native API expects it).
153
262
  * @returns A promise resolving to `true` if the identity signal was
154
263
  * dispatched, `false` otherwise (including the blank-identifier case).
155
264
  * Never rejects.
156
265
  *
157
- * @example
266
+ * ### Required method attribute
267
+ *
268
+ * Identity signals must carry a *method* attribute, and the key Connect
269
+ * requires depends on the signal type:
270
+ *
271
+ * | `signalType` | Required attribute |
272
+ * | -------------------- | -------------------- |
273
+ * | `'loggedIn'` | `loginMethod` |
274
+ * | `'accountRegistered'`| `registrationMethod` |
275
+ *
276
+ * Send the wrong key and the signal fails schema validation and is
277
+ * discarded server-side — while this promise still resolves `true`, because
278
+ * the native SDKs report only that the signal was queued. If you pass
279
+ * `additionalParameters` explicitly, you own supplying the right key.
280
+ *
281
+ * @example Sign-in — `loginMethod` is required
158
282
  * ```ts
159
283
  * import AcousticConnectRN from 'react-native-acoustic-connect-beta'
160
284
  *
285
+ * await AcousticConnectRN.logIdentity('Email', 'user@example.com', 'loggedIn', {
286
+ * loginMethod: 'sso',
287
+ * })
288
+ *
289
+ * // Omitting both arguments is equivalent to the above with
290
+ * // `{ loginMethod: 'email' }` — the bridge defaults to a `loggedIn` signal.
161
291
  * await AcousticConnectRN.logIdentity('Email', 'user@example.com')
162
292
  * ```
293
+ *
294
+ * @example Registration — `registrationMethod` is required
295
+ * ```ts
296
+ * await AcousticConnectRN.logIdentity(
297
+ * 'Email',
298
+ * 'user@example.com',
299
+ * 'accountRegistered',
300
+ * { registrationMethod: 'email' }
301
+ * )
302
+ * ```
163
303
  */
164
304
  logIdentity(identifierName: string, identifierValue: string, signalType?: string, additionalParameters?: Record<string, string>): Promise<boolean>;
165
305
  /**
@@ -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;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;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC1B,oEAAoE;IACpE,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,wEAAwE;IACxE,MAAM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C,OAAO,EAAE,OAAO,GAAG,IAAI,EAAE,KAAK,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAE7F;;;;;;;OAOG;IACH,qBAAqB,IAAI,OAAO,CAAC,oBAAoB,CAAC,CAAA;IAEtD;;;;OAIG;IACH,sBAAsB,IAAI,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAA;CACpD"}
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,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAG3E,MAAM,MAAM,cAAc,GAAG;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAA;AAEjC,MAAM,MAAM,0BAA0B,GAAG,QAAQ,GAAG,iBAAiB,GAAG,MAAM,CAAA;AAE9E;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC1B,oEAAoE;IACpE,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,wEAAwE;IACxE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,gFAAgF;IAChF,OAAO,EAAE,MAAM,CAAA;CAClB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,oBAAoB;IACjC,gEAAgE;IAChE,OAAO,EAAE,OAAO,CAAA;IAChB,4EAA4E;IAC5E,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACxB;AAED,MAAM,WAAW,iBAAkB,SAAQ,YAAY,CAAC;IAAE,GAAG,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,QAAQ,CAAA;CAAE,CAAC;IACxF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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ace margelo::nitro::acousticconnectrn { struct PushErrorInfo; }
25
25
  #include "JVariant_NullType_Boolean.hpp"
26
26
  #include "JVariant_Boolean_String_Double.hpp"
27
27
  #include <unordered_map>
28
+ #include <NitroModules/AnyMap.hpp>
29
+ #include <NitroModules/JAnyMap.hpp>
28
30
  #include <NitroModules/ArrayBuffer.hpp>
29
31
  #include <NitroModules/JArrayBuffer.hpp>
30
32
  #include "PushErrorInfo.hpp"
@@ -119,15 +121,9 @@ namespace margelo::nitro::acousticconnectrn {
119
121
  }(), level);
120
122
  return static_cast<bool>(__result);
121
123
  }
122
- bool JHybridAcousticConnectRNSpec::logSignal(const std::unordered_map<std::string, std::variant<bool, std::string, double>>& values, double level) {
123
- static const auto method = _javaPart->javaClassStatic()->getMethod<jboolean(jni::alias_ref<jni::JMap<jni::JString, JVariant_Boolean_String_Double>> /* values */, double /* level */)>("logSignal");
124
- auto __result = method(_javaPart, [&]() -> jni::local_ref<jni::JMap<jni::JString, JVariant_Boolean_String_Double>> {
125
- auto __map = jni::JHashMap<jni::JString, JVariant_Boolean_String_Double>::create(values.size());
126
- for (const auto& __entry : values) {
127
- __map->put(jni::make_jstring(__entry.first), JVariant_Boolean_String_Double::fromCpp(__entry.second));
128
- }
129
- return __map;
130
- }(), level);
124
+ bool JHybridAcousticConnectRNSpec::logSignal(const std::shared_ptr<AnyMap>& values, double level) {
125
+ static const auto method = _javaPart->javaClassStatic()->getMethod<jboolean(jni::alias_ref<JAnyMap::javaobject> /* values */, double /* level */)>("logSignal");
126
+ auto __result = method(_javaPart, JAnyMap::create(values), level);
131
127
  return static_cast<bool>(__result);
132
128
  }
133
129
  bool JHybridAcousticConnectRNSpec::logExceptionEvent(const std::string& message, const std::string& stackInfo, bool unhandled) {
@@ -64,7 +64,7 @@ namespace margelo::nitro::acousticconnectrn {
64
64
  std::optional<std::variant<nitro::NullType, std::string>> getStringItemForKey(const std::string& theDefault, const std::string& key, const std::string& moduleName) override;
65
65
  double getNumberItemForKey(double theDefault, const std::string& key, const std::string& moduleName) override;
66
66
  bool logCustomEvent(const std::string& eventName, const std::unordered_map<std::string, std::variant<bool, std::string, double>>& values, double level) override;
67
- bool logSignal(const std::unordered_map<std::string, std::variant<bool, std::string, double>>& values, double level) override;
67
+ bool logSignal(const std::shared_ptr<AnyMap>& values, double level) override;
68
68
  bool logExceptionEvent(const std::string& message, const std::string& stackInfo, bool unhandled) override;
69
69
  bool logLocation() override;
70
70
  bool logLocationWithLatitudeLongitude(double latitude, double longitude, double level) override;
@@ -11,6 +11,7 @@ import androidx.annotation.Keep
11
11
  import com.facebook.jni.HybridData
12
12
  import com.facebook.proguard.annotations.DoNotStrip
13
13
  import com.margelo.nitro.core.NullType
14
+ import com.margelo.nitro.core.AnyMap
14
15
  import com.margelo.nitro.core.Promise
15
16
  import com.margelo.nitro.core.ArrayBuffer
16
17
  import com.margelo.nitro.core.HybridObject
@@ -73,7 +74,7 @@ abstract class HybridAcousticConnectRNSpec: HybridObject() {
73
74
 
74
75
  @DoNotStrip
75
76
  @Keep
76
- abstract fun logSignal(values: Map<String, Variant_Boolean_String_Double>, level: Double): Boolean
77
+ abstract fun logSignal(values: AnyMap, level: Double): Boolean
77
78
 
78
79
  @DoNotStrip
79
80
  @Keep
@@ -19,6 +19,7 @@ namespace margelo::nitro::acousticconnectrn { struct PushPermissionResult; }
19
19
  #include "HybridAcousticConnectRNSpec.hpp"
20
20
  #include "PushErrorInfo.hpp"
21
21
  #include "PushPermissionResult.hpp"
22
+ #include <NitroModules/AnyMap.hpp>
22
23
  #include <NitroModules/ArrayBuffer.hpp>
23
24
  #include <NitroModules/Null.hpp>
24
25
  #include <NitroModules/Promise.hpp>
@@ -24,6 +24,7 @@ namespace margelo::nitro::acousticconnectrn { struct PushPermissionResult; }
24
24
  #include <NitroModules/Null.hpp>
25
25
  #include <optional>
26
26
  #include <unordered_map>
27
+ #include <NitroModules/AnyMap.hpp>
27
28
  #include <NitroModules/Promise.hpp>
28
29
  #include <NitroModules/ArrayBuffer.hpp>
29
30
  #include <NitroModules/ArrayBufferHolder.hpp>
@@ -160,7 +161,7 @@ namespace margelo::nitro::acousticconnectrn {
160
161
  auto __value = std::move(__result.value());
161
162
  return __value;
162
163
  }
163
- inline bool logSignal(const std::unordered_map<std::string, std::variant<bool, std::string, double>>& values, double level) override {
164
+ inline bool logSignal(const std::shared_ptr<AnyMap>& values, double level) override {
164
165
  auto __result = _swiftPart.logSignal(values, std::forward<decltype(level)>(level));
165
166
  if (__result.hasError()) [[unlikely]] {
166
167
  std::rethrow_exception(__result.error());
@@ -23,7 +23,7 @@ public protocol HybridAcousticConnectRNSpec_protocol: HybridObject {
23
23
  func getStringItemForKey(theDefault: String, key: String, moduleName: String) throws -> Variant_NullType_String?
24
24
  func getNumberItemForKey(theDefault: Double, key: String, moduleName: String) throws -> Double
25
25
  func logCustomEvent(eventName: String, values: Dictionary<String, Variant_Bool_String_Double>, level: Double) throws -> Bool
26
- func logSignal(values: Dictionary<String, Variant_Bool_String_Double>, level: Double) throws -> Bool
26
+ func logSignal(values: AnyMap, level: Double) throws -> Bool
27
27
  func logExceptionEvent(message: String, stackInfo: String, unhandled: Bool) throws -> Bool
28
28
  func logLocation() throws -> Bool
29
29
  func logLocationWithLatitudeLongitude(latitude: Double, longitude: Double, level: Double) throws -> Bool
@@ -296,32 +296,9 @@ open class HybridAcousticConnectRNSpec_cxx {
296
296
  }
297
297
 
298
298
  @inline(__always)
299
- public final func logSignal(values: bridge.std__unordered_map_std__string__std__variant_bool__std__string__double__, level: Double) -> bridge.Result_bool_ {
299
+ public final func logSignal(values: margelo.nitro.SharedAnyMap, level: Double) -> bridge.Result_bool_ {
300
300
  do {
301
- let __result = try self.__implementation.logSignal(values: { () -> Dictionary<String, Variant_Bool_String_Double> in
302
- var __dictionary = Dictionary<String, Variant_Bool_String_Double>(minimumCapacity: values.size())
303
- let __keys = bridge.get_std__unordered_map_std__string__std__variant_bool__std__string__double___keys(values)
304
- for __key in __keys {
305
- let __value = bridge.get_std__unordered_map_std__string__std__variant_bool__std__string__double___value(values, __key)
306
- __dictionary[String(__key)] = { () -> Variant_Bool_String_Double in
307
- let __variant = bridge.std__variant_bool__std__string__double_(__value)
308
- switch __variant.index() {
309
- case 0:
310
- let __actual = __variant.get_0()
311
- return .first(__actual)
312
- case 1:
313
- let __actual = __variant.get_1()
314
- return .second(String(__actual))
315
- case 2:
316
- let __actual = __variant.get_2()
317
- return .third(__actual)
318
- default:
319
- fatalError("Variant can never have index \(__variant.index())!")
320
- }
321
- }()
322
- }
323
- return __dictionary
324
- }(), level: level)
301
+ let __result = try self.__implementation.logSignal(values: AnyMap(withCppPart: values), level: level)
325
302
  let __resultCpp = __result
326
303
  return bridge.create_Result_bool_(__resultCpp)
327
304
  } catch (let __error) {
@@ -23,6 +23,7 @@ namespace margelo::nitro::acousticconnectrn { struct PushPermissionResult; }
23
23
  #include <NitroModules/Null.hpp>
24
24
  #include <optional>
25
25
  #include <unordered_map>
26
+ #include <NitroModules/AnyMap.hpp>
26
27
  #include <NitroModules/Promise.hpp>
27
28
  #include <NitroModules/ArrayBuffer.hpp>
28
29
  #include "PushErrorInfo.hpp"
@@ -69,7 +70,7 @@ namespace margelo::nitro::acousticconnectrn {
69
70
  virtual std::optional<std::variant<nitro::NullType, std::string>> getStringItemForKey(const std::string& theDefault, const std::string& key, const std::string& moduleName) = 0;
70
71
  virtual double getNumberItemForKey(double theDefault, const std::string& key, const std::string& moduleName) = 0;
71
72
  virtual bool logCustomEvent(const std::string& eventName, const std::unordered_map<std::string, std::variant<bool, std::string, double>>& values, double level) = 0;
72
- virtual bool logSignal(const std::unordered_map<std::string, std::variant<bool, std::string, double>>& values, double level) = 0;
73
+ virtual bool logSignal(const std::shared_ptr<AnyMap>& values, double level) = 0;
73
74
  virtual bool logExceptionEvent(const std::string& message, const std::string& stackInfo, bool unhandled) = 0;
74
75
  virtual bool logLocation() = 0;
75
76
  virtual bool logLocationWithLatitudeLongitude(double latitude, double longitude, double level) = 0;
package/package.json CHANGED
@@ -79,6 +79,7 @@
79
79
  "!android/src/test/**",
80
80
  "android/config.gradle",
81
81
  "android/src/main/assets/**",
82
+ "!android/src/main/assets/ConnectLayoutConfig.json",
82
83
  "ios/**/*.h",
83
84
  "ios/**/*.m",
84
85
  "ios/**/*.mm",
@@ -229,7 +230,7 @@
229
230
  "source": "src/index",
230
231
  "summary": "react-native ios android tealeaf connect cxa wxca er enhanced-replay",
231
232
  "types": "./lib/typescript/src/index.d.ts",
232
- "version": "19.0.14",
233
+ "version": "19.0.16",
233
234
  "workspaces": [
234
235
  "example",
235
236
  "Examples/bare-workflow"
package/src/TLTRN.ts CHANGED
@@ -110,11 +110,36 @@ class TLTRN {
110
110
  return result;
111
111
  };
112
112
 
113
- static logScreenLayout = (name: string | undefined) => {
113
+ /**
114
+ * Sentinel for the native `delay` argument meaning "use the
115
+ * `CaptureLayoutDelay` configured for this screen". Both bridges resolve it
116
+ * from the layout config; anything >= 0 is an explicit delay in
117
+ * milliseconds.
118
+ */
119
+ static USE_CONFIGURED_CAPTURE_DELAY = -1;
120
+
121
+ /**
122
+ * Captures the layout of the current screen.
123
+ *
124
+ * @param name Screen name to associate with the capture.
125
+ * @param delayMs Milliseconds to wait before capturing. Omit it to use the
126
+ * `CaptureLayoutDelay` from `ConnectConfig.json` — that is the setting to
127
+ * reach for when a screen transition animation is still running and the
128
+ * capture would otherwise catch a half-rendered screen. Pass `0` to
129
+ * capture immediately.
130
+ *
131
+ * Passing no delay used to send a hardcoded `0`, which made
132
+ * `CaptureLayoutDelay` inert for React Native apps and fired the capture at
133
+ * the *start* of the transition rather than after it.
134
+ */
135
+ static logScreenLayout = (name: string | undefined, delayMs?: number) => {
114
136
  TLTRN.currentScreen = name || '';
115
137
  let result = false
116
138
  try {
117
- result = AcousticConnectRN.logScreenLayout(TLTRN.currentScreen, 0);
139
+ result = AcousticConnectRN.logScreenLayout(
140
+ TLTRN.currentScreen,
141
+ delayMs === undefined ? TLTRN.USE_CONFIGURED_CAPTURE_DELAY : delayMs
142
+ );
118
143
  } catch (error: Error | any) {
119
144
  console.log('LogScreenLayout error: ', error.message);
120
145
  }
@@ -356,7 +381,10 @@ class TLTRN {
356
381
  static logTeal = async () => {
357
382
  try {
358
383
  TLTRN.isLoggingData = 1;
359
- var res = await AcousticConnectRN.logScreenLayout(TLTRN.currentScreen, -1);
384
+ var res = await AcousticConnectRN.logScreenLayout(
385
+ TLTRN.currentScreen,
386
+ TLTRN.USE_CONFIGURED_CAPTURE_DELAY
387
+ );
360
388
  var dict = { ReactLayoutTime: TLTRN.totalRenderTime };
361
389
  var result = await AcousticConnectRN.logCustomEvent("ReactPlugin", dict, 1);
362
390
  if (TLTRN.displayDebug) {
package/src/index.ts CHANGED
@@ -41,4 +41,9 @@ try {
41
41
  }
42
42
 
43
43
  export { Connect, TLTRN, KeyboardListener, DialogListener, useDialogTracking, DialogDebugger, withAcousticAutoDialog }
44
+
45
+ // Re-exported so callers can name a `logSignal` payload without importing
46
+ // from `react-native-nitro-modules` — the spec aliases nitro's AnyMap only
47
+ // because that is the one type nitrogen accepts for arbitrary JSON.
48
+ export type { SignalValues } from './specs/react-native-acoustic-connect.nitro'
44
49
  export default AcousticConnectRN