react-native-acoustic-connect-beta 19.0.13 → 19.0.15
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/CHANGELOG.md +6 -0
- package/ConnectConfig.example.json +7 -7
- package/README.md +123 -1
- package/android/build.gradle +64 -0
- package/android/config.gradle +123 -12
- package/android/src/main/assets/ConnectAdvancedConfig.json +1 -1
- package/android/src/main/assets/ConnectBasicConfig.properties +1 -1
- package/android/src/main/java/com/acousticconnectrn/HybridAcousticConnectRN.kt +164 -18
- package/cli/index.mjs +0 -0
- package/ios/AcousticConnectRNConfig.json +153 -8
- package/ios/ConnectRNParsing.swift +152 -0
- package/ios/HybridAcousticConnectRN.swift +56 -15
- package/lib/commonjs/index.js +3 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +5 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/react-native-acoustic-connect.nitro.d.ts +139 -10
- package/lib/typescript/src/specs/react-native-acoustic-connect.nitro.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JHybridAcousticConnectRNSpec.cpp +5 -9
- package/nitrogen/generated/android/c++/JHybridAcousticConnectRNSpec.hpp +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/acousticconnectrn/HybridAcousticConnectRNSpec.kt +2 -1
- package/nitrogen/generated/ios/AcousticConnectRN-Swift-Cxx-Umbrella.hpp +1 -0
- package/nitrogen/generated/ios/c++/HybridAcousticConnectRNSpecSwift.hpp +2 -1
- package/nitrogen/generated/ios/swift/HybridAcousticConnectRNSpec.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridAcousticConnectRNSpec_cxx.swift +2 -25
- package/nitrogen/generated/shared/c++/HybridAcousticConnectRNSpec.hpp +2 -1
- package/package.json +2 -1
- package/src/index.ts +5 -0
- package/src/specs/react-native-acoustic-connect.nitro.ts +141 -10
- package/Examples/SampleUI/ConnectConfig.json +0 -180
|
@@ -233,22 +233,46 @@ class HybridAcousticConnectRN: HybridAcousticConnectRNSpec {
|
|
|
233
233
|
"textBox:textChange", "textBox:textChanged", "textBox:textFieldDidChange", "toggleButton:click"
|
|
234
234
|
]
|
|
235
235
|
|
|
236
|
+
// Keys the bridge consumes somewhere other than this method: load()
|
|
237
|
+
// (the enable parameters and verbose native logging), the push
|
|
238
|
+
// resolver, or the install-time podspec / gradle scripts. Enumerated
|
|
239
|
+
// so the unrecognised-key warning below fires only on keys that
|
|
240
|
+
// nothing consumes. A key falling through this method silently is what
|
|
241
|
+
// kept the layout-config mismatch below hidden for so long.
|
|
242
|
+
let handledElsewhere: Set<String> = [
|
|
243
|
+
"AppKey", "PostMessageUrl", // load() -> enable(with:)
|
|
244
|
+
"useRelease", // load() -> verbose native logging
|
|
245
|
+
"PushEnabled", "iOSPushMode", "iOSAppGroupIdentifier", // ConnectRNParsing.resolvePushConfig
|
|
246
|
+
"iOSDevelopmentTeam", // install-time signing (podspec / Expo plugin)
|
|
247
|
+
"iOSVersion", "AndroidVersion", // install-time (podspec / gradle)
|
|
248
|
+
"AndroidNotificationIconResName", // Android-only
|
|
249
|
+
"layoutConfigAndroid", // Android-only
|
|
250
|
+
]
|
|
251
|
+
|
|
236
252
|
for (key, value) in connectData {
|
|
237
253
|
// Skip keys load() passes directly to enable — re-applying is harmless but redundant.
|
|
238
254
|
if key == "AppKey" || key == "PostMessageUrl" { continue }
|
|
239
255
|
|
|
240
256
|
if tealeafKeys.contains(key) || eocoreKeys.contains(key) {
|
|
241
257
|
ConnectConfigStore.set(key, value: value)
|
|
242
|
-
} else if key
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
ConnectConfigStore.set("AutoLayout", value: autoLayout)
|
|
246
|
-
}
|
|
247
|
-
if let appendMapIds = layoutConfig["AppendMapIds"] {
|
|
248
|
-
ConnectConfigStore.set("AppendMapIds", value: appendMapIds)
|
|
249
|
-
}
|
|
258
|
+
} else if !handledElsewhere.contains(key),
|
|
259
|
+
!ConnectRNParsing.layoutConfigKeys.contains(key) {
|
|
260
|
+
configLog.warning("Connect.\(key, privacy: .public) in ConnectConfig.json is not a key this SDK applies — check it against the documented keys. Unrecognised keys are ignored.")
|
|
250
261
|
}
|
|
251
262
|
}
|
|
263
|
+
|
|
264
|
+
// Resolved outside the loop: two keys feed this block (the shared
|
|
265
|
+
// `layoutConfig` plus the platform-suffixed `layoutConfigIos`, which
|
|
266
|
+
// is what the shipped ConnectConfig.json template writes and what the
|
|
267
|
+
// podspec copies into the bundle verbatim), and their contents map onto
|
|
268
|
+
// differently-named store keys — so it is not a per-key passthrough
|
|
269
|
+
// like the lists above. Matching only the unsuffixed `layoutConfig`
|
|
270
|
+
// here meant the entire iOS layout block was silently dropped, leaving
|
|
271
|
+
// per-screen settings such as ScreenShot unconfigurable from
|
|
272
|
+
// ConnectConfig.json. See ConnectRNParsing.resolveLayoutOverrides.
|
|
273
|
+
for (storeKey, storeValue) in ConnectRNParsing.resolveLayoutOverrides(from: connectData) {
|
|
274
|
+
ConnectConfigStore.set(storeKey, value: storeValue)
|
|
275
|
+
}
|
|
252
276
|
}
|
|
253
277
|
|
|
254
278
|
// MARK: - Gate-keeper API
|
|
@@ -510,13 +534,24 @@ class HybridAcousticConnectRN: HybridAcousticConnectRNSpec {
|
|
|
510
534
|
}
|
|
511
535
|
|
|
512
536
|
/// Log signal data.
|
|
537
|
+
///
|
|
538
|
+
/// Takes an `AnyMap` rather than a map of scalars so JS callers can send
|
|
539
|
+
/// arbitrary JSON — nested objects and arrays included. `CTSignalMessage`
|
|
540
|
+
/// embeds the dictionary verbatim and gates only on
|
|
541
|
+
/// `NSJSONSerialization.isValidJSONObject:`, so nesting needs no special
|
|
542
|
+
/// handling beyond producing a JSON-representable dictionary:
|
|
543
|
+
/// `AnyMap.toDictionary()` yields `[String: Any?]` (nested containers
|
|
544
|
+
/// carry optionals too), which `jsonSafeDictionary` normalises by
|
|
545
|
+
/// unwrapping the optionals and mapping `null` to `NSNull`. Nothing is
|
|
546
|
+
/// flattened or reshaped.
|
|
513
547
|
/// - Parameters:
|
|
514
|
-
/// - values:
|
|
548
|
+
/// - values: signal payload; objects, arrays and scalars are all carried through.
|
|
515
549
|
/// - level: set a custom log level to the event.
|
|
516
550
|
/// - Returns: Boolean value will return whether it was able to log the signal message.
|
|
517
|
-
func logSignal(values:
|
|
551
|
+
func logSignal(values: AnyMap, level: Double) throws -> Bool {
|
|
518
552
|
let logLevel = try getLogLevel(level: level)
|
|
519
|
-
let
|
|
553
|
+
let payload = ConnectRNParsing.jsonSafeDictionary(values.toDictionary())
|
|
554
|
+
let result = ConnectCustomEvent().logSignal(payload, level: logLevel)
|
|
520
555
|
return result
|
|
521
556
|
}
|
|
522
557
|
|
|
@@ -535,17 +570,23 @@ class HybridAcousticConnectRN: HybridAcousticConnectRNSpec {
|
|
|
535
570
|
/// - identifierValue: Identifier value, e.g. "user@example.com".
|
|
536
571
|
/// - signalType: Optional signal type; defaults to "loggedIn" when omitted.
|
|
537
572
|
/// - additionalParameters: Optional extra key/value pairs merged into the
|
|
538
|
-
/// signal. Defaults
|
|
539
|
-
///
|
|
573
|
+
/// signal. Defaults, only when `nil` (omitted), to the method attribute
|
|
574
|
+
/// the resolved signal type requires — `["loginMethod": "email"]` for
|
|
575
|
+
/// `loggedIn`, `["registrationMethod": "email"]` otherwise (see
|
|
576
|
+
/// `ConnectRNParsing.defaultIdentityParameters(for:)`). An explicit map
|
|
577
|
+
/// — including an empty one — is used as-is.
|
|
540
578
|
/// - Returns: A promise resolving to `true` if the signal was dispatched,
|
|
541
579
|
/// `false` otherwise. Never rejects.
|
|
542
580
|
func logIdentity(identifierName: String, identifierValue: String, signalType: String?, additionalParameters: [String: String]?) throws -> Promise<Bool> {
|
|
581
|
+
let resolvedSignalType = signalType ?? "loggedIn"
|
|
582
|
+
let resolvedParameters = additionalParameters
|
|
583
|
+
?? ConnectRNParsing.defaultIdentityParameters(for: resolvedSignalType)
|
|
543
584
|
return Promise.async { @MainActor in
|
|
544
585
|
ConnectSDK.shared.identity.log(
|
|
545
586
|
identifierName: identifierName,
|
|
546
587
|
identifierValue: identifierValue,
|
|
547
|
-
signalType:
|
|
548
|
-
additionalParameters:
|
|
588
|
+
signalType: resolvedSignalType,
|
|
589
|
+
additionalParameters: resolvedParameters
|
|
549
590
|
)
|
|
550
591
|
}
|
|
551
592
|
}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -80,5 +80,8 @@ try {
|
|
|
80
80
|
} catch (error) {
|
|
81
81
|
throw new Error('[AcousticConnectRN] Failed to load the native HybridObject. This almost ' + 'always means a `react-native-nitro-modules` version mismatch: this SDK is ' + 'built against the exact version declared in its peerDependencies, so your ' + 'app must resolve that same version (check `npm ls react-native-nitro-modules`). ' + `Original error: ${String(error)}`);
|
|
82
82
|
}
|
|
83
|
+
// Re-exported so callers can name a `logSignal` payload without importing
|
|
84
|
+
// from `react-native-nitro-modules` — the spec aliases nitro's AnyMap only
|
|
85
|
+
// because that is the one type nitrogen accepts for arbitrary JSON.
|
|
83
86
|
var _default = exports.default = AcousticConnectRN;
|
|
84
87
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNativeNitroModules","require","_Connect","_interopRequireDefault","_KeyboardListener","_DialogListener","_useDialogTracking","_withAcousticAutoDialog","_DialogDebugger","_TLTRN","e","__esModule","default","AcousticConnectRN","NitroModules","createHybridObject","error","Error","String","_default","exports"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,IAAAA,wBAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,eAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,kBAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,uBAAA,GAAAN,OAAA;AACA,IAAAO,eAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,MAAA,GAAAN,sBAAA,CAAAF,OAAA;AAA2B,SAAAE,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AArB3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA,IAAIG,iBAAwC;AAC5C,IAAI;EACFA,iBAAiB,GAAGC,qCAAY,CAACC,kBAAkB,CAAwB,mBAAmB,CAAC;AACjG,CAAC,CAAC,OAAOC,KAAK,EAAE;EACd,MAAM,IAAIC,KAAK,CACb,0EAA0E,GACxE,4EAA4E,GAC5E,4EAA4E,GAC5E,kFAAkF,GAClF,mBAAmBC,MAAM,CAACF,KAAK,CAAC,EACpC,CAAC;AACH;
|
|
1
|
+
{"version":3,"names":["_reactNativeNitroModules","require","_Connect","_interopRequireDefault","_KeyboardListener","_DialogListener","_useDialogTracking","_withAcousticAutoDialog","_DialogDebugger","_TLTRN","e","__esModule","default","AcousticConnectRN","NitroModules","createHybridObject","error","Error","String","_default","exports"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,IAAAA,wBAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,eAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,kBAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,uBAAA,GAAAN,OAAA;AACA,IAAAO,eAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,MAAA,GAAAN,sBAAA,CAAAF,OAAA;AAA2B,SAAAE,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AArB3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA,IAAIG,iBAAwC;AAC5C,IAAI;EACFA,iBAAiB,GAAGC,qCAAY,CAACC,kBAAkB,CAAwB,mBAAmB,CAAC;AACjG,CAAC,CAAC,OAAOC,KAAK,EAAE;EACd,MAAM,IAAIC,KAAK,CACb,0EAA0E,GACxE,4EAA4E,GAC5E,4EAA4E,GAC5E,kFAAkF,GAClF,mBAAmBC,MAAM,CAACF,KAAK,CAAC,EACpC,CAAC;AACH;AAIA;AACA;AACA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAR,OAAA,GAEeC,iBAAiB","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -35,5 +35,10 @@ try {
|
|
|
35
35
|
throw new Error('[AcousticConnectRN] Failed to load the native HybridObject. This almost ' + 'always means a `react-native-nitro-modules` version mismatch: this SDK is ' + 'built against the exact version declared in its peerDependencies, so your ' + 'app must resolve that same version (check `npm ls react-native-nitro-modules`). ' + `Original error: ${String(error)}`);
|
|
36
36
|
}
|
|
37
37
|
export { Connect, TLTRN, KeyboardListener, DialogListener, useDialogTracking, DialogDebugger, withAcousticAutoDialog };
|
|
38
|
+
|
|
39
|
+
// Re-exported so callers can name a `logSignal` payload without importing
|
|
40
|
+
// from `react-native-nitro-modules` — the spec aliases nitro's AnyMap only
|
|
41
|
+
// because that is the one type nitrogen accepts for arbitrary JSON.
|
|
42
|
+
|
|
38
43
|
export default AcousticConnectRN;
|
|
39
44
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NitroModules","Connect","KeyboardListener","DialogListener","useDialogTracking","withAcousticAutoDialog","DialogDebugger","TLTRN","AcousticConnectRN","createHybridObject","error","Error","String"],"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;AAC1C,OAAOC,gBAAgB,MAAM,0BAA0B;AACvD,OAAOC,cAAc,MAAM,wBAAwB;AACnD,OAAOC,iBAAiB,MAAM,2BAA2B;AACzD,SAASC,sBAAsB,QAAQ,gCAAgC;AACvE,OAAOC,cAAc,MAAM,wBAAwB;AACnD,OAAOC,KAAK,MAAM,SAAS;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA,IAAIC,iBAAwC;AAC5C,IAAI;EACFA,iBAAiB,GAAGR,YAAY,CAACS,kBAAkB,CAAwB,mBAAmB,CAAC;AACjG,CAAC,CAAC,OAAOC,KAAK,EAAE;EACd,MAAM,IAAIC,KAAK,CACb,0EAA0E,GACxE,4EAA4E,GAC5E,4EAA4E,GAC5E,kFAAkF,GAClF,mBAAmBC,MAAM,CAACF,KAAK,CAAC,EACpC,CAAC;AACH;AAEA,SAAST,OAAO,EAAEM,KAAK,EAAEL,gBAAgB,EAAEC,cAAc,EAAEC,iBAAiB,EAAEE,cAAc,EAAED,sBAAsB;
|
|
1
|
+
{"version":3,"names":["NitroModules","Connect","KeyboardListener","DialogListener","useDialogTracking","withAcousticAutoDialog","DialogDebugger","TLTRN","AcousticConnectRN","createHybridObject","error","Error","String"],"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;AAC1C,OAAOC,gBAAgB,MAAM,0BAA0B;AACvD,OAAOC,cAAc,MAAM,wBAAwB;AACnD,OAAOC,iBAAiB,MAAM,2BAA2B;AACzD,SAASC,sBAAsB,QAAQ,gCAAgC;AACvE,OAAOC,cAAc,MAAM,wBAAwB;AACnD,OAAOC,KAAK,MAAM,SAAS;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA,IAAIC,iBAAwC;AAC5C,IAAI;EACFA,iBAAiB,GAAGR,YAAY,CAACS,kBAAkB,CAAwB,mBAAmB,CAAC;AACjG,CAAC,CAAC,OAAOC,KAAK,EAAE;EACd,MAAM,IAAIC,KAAK,CACb,0EAA0E,GACxE,4EAA4E,GAC5E,4EAA4E,GAC5E,kFAAkF,GAClF,mBAAmBC,MAAM,CAACF,KAAK,CAAC,EACpC,CAAC;AACH;AAEA,SAAST,OAAO,EAAEM,KAAK,EAAEL,gBAAgB,EAAEC,cAAc,EAAEC,iBAAiB,EAAEE,cAAc,EAAED,sBAAsB;;AAEpH;AACA;AACA;;AAEA,eAAeG,iBAAiB","ignoreList":[]}
|
|
@@ -20,5 +20,6 @@ import DialogDebugger from './utils/DialogDebugger';
|
|
|
20
20
|
import TLTRN from './TLTRN';
|
|
21
21
|
declare let AcousticConnectRN: AcousticConnectRNSpec;
|
|
22
22
|
export { Connect, TLTRN, KeyboardListener, DialogListener, useDialogTracking, DialogDebugger, withAcousticAutoDialog };
|
|
23
|
+
export type { SignalValues } from './specs/react-native-acoustic-connect.nitro';
|
|
23
24
|
export default AcousticConnectRN;
|
|
24
25
|
//# 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;AAC7G,OAAO,OAAO,MAAM,sBAAsB,CAAA;AAC1C,OAAO,gBAAgB,MAAM,0BAA0B,CAAA;AACvD,OAAO,cAAc,MAAM,wBAAwB,CAAA;AACnD,OAAO,iBAAiB,MAAM,2BAA2B,CAAA;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,cAAc,MAAM,wBAAwB,CAAA;AACnD,OAAO,KAAK,MAAM,SAAS,CAAA;AAQ3B,QAAA,IAAI,iBAAiB,EAAE,qBAAqB,CAAA;AAa5C,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,iBAAiB,EAAE,cAAc,EAAE,sBAAsB,EAAE,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;AAC1C,OAAO,gBAAgB,MAAM,0BAA0B,CAAA;AACvD,OAAO,cAAc,MAAM,wBAAwB,CAAA;AACnD,OAAO,iBAAiB,MAAM,2BAA2B,CAAA;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,cAAc,MAAM,wBAAwB,CAAA;AACnD,OAAO,KAAK,MAAM,SAAS,CAAA;AAQ3B,QAAA,IAAI,iBAAiB,EAAE,qBAAqB,CAAA;AAa5C,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,iBAAiB,EAAE,cAAc,EAAE,sBAAsB,EAAE,CAAA;AAKtH,YAAY,EAAE,YAAY,EAAE,MAAM,6CAA6C,CAAA;AAC/E,eAAe,iBAAiB,CAAA"}
|
|
@@ -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
|
-
|
|
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;
|
|
@@ -121,6 +212,13 @@ export interface AcousticConnectRN extends HybridObject<{
|
|
|
121
212
|
logDialogShowEvent(dialogId: string, dialogTitle: string, dialogType: string): boolean;
|
|
122
213
|
logDialogDismissEvent(dialogId: string, dismissReason: string): boolean;
|
|
123
214
|
logDialogButtonClickEvent(dialogId: string, buttonText: string, buttonIndex: number): boolean;
|
|
215
|
+
/**
|
|
216
|
+
* Logs a custom event against a tracked dialog.
|
|
217
|
+
*
|
|
218
|
+
* `values` is flat for the same reason as {@link logCustomEvent} — this
|
|
219
|
+
* routes to the native custom-event API, whose Android path carries string
|
|
220
|
+
* values only.
|
|
221
|
+
*/
|
|
124
222
|
logDialogCustomEvent(dialogId: string, eventName: string, values: Record<string, string | number | boolean>): boolean;
|
|
125
223
|
/**
|
|
126
224
|
* Logs a user identity so the current device/session can be associated with
|
|
@@ -143,23 +241,54 @@ export interface AcousticConnectRN extends HybridObject<{
|
|
|
143
241
|
* `'loggedIn'` when omitted (identity logging typically marks a sign-in),
|
|
144
242
|
* overriding the native SDKs' own `'pageView'` default.
|
|
145
243
|
* @param additionalParameters Optional extra key/value pairs merged into the
|
|
146
|
-
* signal payload. Only when omitted (`undefined`) does the bridge supply
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
* API expects it).
|
|
244
|
+
* signal payload. Only when omitted (`undefined`) does the bridge supply a
|
|
245
|
+
* default, and that default follows the resolved `signalType` — see
|
|
246
|
+
* **Required method attribute** below. An explicitly-provided map is used
|
|
247
|
+
* as-is, so passing an empty `{}` sends no extra parameters (the default is
|
|
248
|
+
* not merged in). A `'url'` entry is honoured uniformly on both platforms:
|
|
249
|
+
* on Android it is routed to the SDK's explicit `url` parameter, on iOS it
|
|
250
|
+
* rides inside the parameter map (where the native API expects it).
|
|
153
251
|
* @returns A promise resolving to `true` if the identity signal was
|
|
154
252
|
* dispatched, `false` otherwise (including the blank-identifier case).
|
|
155
253
|
* Never rejects.
|
|
156
254
|
*
|
|
157
|
-
*
|
|
255
|
+
* ### Required method attribute
|
|
256
|
+
*
|
|
257
|
+
* Identity signals must carry a *method* attribute, and the key Connect
|
|
258
|
+
* requires depends on the signal type:
|
|
259
|
+
*
|
|
260
|
+
* | `signalType` | Required attribute |
|
|
261
|
+
* | -------------------- | -------------------- |
|
|
262
|
+
* | `'loggedIn'` | `loginMethod` |
|
|
263
|
+
* | `'accountRegistered'`| `registrationMethod` |
|
|
264
|
+
*
|
|
265
|
+
* Send the wrong key and the signal fails schema validation and is
|
|
266
|
+
* discarded server-side — while this promise still resolves `true`, because
|
|
267
|
+
* the native SDKs report only that the signal was queued. If you pass
|
|
268
|
+
* `additionalParameters` explicitly, you own supplying the right key.
|
|
269
|
+
*
|
|
270
|
+
* @example Sign-in — `loginMethod` is required
|
|
158
271
|
* ```ts
|
|
159
272
|
* import AcousticConnectRN from 'react-native-acoustic-connect-beta'
|
|
160
273
|
*
|
|
274
|
+
* await AcousticConnectRN.logIdentity('Email', 'user@example.com', 'loggedIn', {
|
|
275
|
+
* loginMethod: 'sso',
|
|
276
|
+
* })
|
|
277
|
+
*
|
|
278
|
+
* // Omitting both arguments is equivalent to the above with
|
|
279
|
+
* // `{ loginMethod: 'email' }` — the bridge defaults to a `loggedIn` signal.
|
|
161
280
|
* await AcousticConnectRN.logIdentity('Email', 'user@example.com')
|
|
162
281
|
* ```
|
|
282
|
+
*
|
|
283
|
+
* @example Registration — `registrationMethod` is required
|
|
284
|
+
* ```ts
|
|
285
|
+
* await AcousticConnectRN.logIdentity(
|
|
286
|
+
* 'Email',
|
|
287
|
+
* 'user@example.com',
|
|
288
|
+
* 'accountRegistered',
|
|
289
|
+
* { registrationMethod: 'email' }
|
|
290
|
+
* )
|
|
291
|
+
* ```
|
|
163
292
|
*/
|
|
164
293
|
logIdentity(identifierName: string, identifierValue: string, signalType?: string, additionalParameters?: Record<string, string>): Promise<boolean>;
|
|
165
294
|
/**
|
|
@@ -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":[],"m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IAUnB;;;;;;;;;;;OAWG;IACH,wBAAwB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAEpE;;;;;;OAMG;IACH,qBAAqB,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAE7D;;;;;;;;;;;;;OAaG;IACH,0BAA0B,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAEjG;;;;;;;;;;;OAWG;IACH,sBAAsB,CAAC,gBAAgB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAIvH;;;;;;;;;;;;;OAaG;IACH,2BAA2B,CAAC,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"}
|
|
@@ -25,6 +25,8 @@ namespace 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::
|
|
123
|
-
static const auto method = _javaPart->javaClassStatic()->getMethod<jboolean(jni::alias_ref<
|
|
124
|
-
auto __result = method(_javaPart,
|
|
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::
|
|
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:
|
|
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::
|
|
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:
|
|
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:
|
|
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:
|
|
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::
|
|
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.
|
|
233
|
+
"version": "19.0.15",
|
|
233
234
|
"workspaces": [
|
|
234
235
|
"example",
|
|
235
236
|
"Examples/bare-workflow"
|
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
|