react-native-acoustic-connect-beta 19.0.16 → 19.0.17

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 CHANGED
@@ -1,3 +1,8 @@
1
+ ## 19.0.17 (2026-09-02)
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.16 (2026-08-31)
2
7
 
3
8
  ### Reverts
@@ -1,4 +1,4 @@
1
- #Mon Aug 31 14:13:24 GMT 2026
1
+ #Wed Sep 02 13:28:45 GMT 2026
2
2
  UseWhiteList=true
3
3
  PrintScreen=3
4
4
  UseRandomSample=false
@@ -877,7 +877,27 @@ class HybridAcousticConnectRN : HybridAcousticConnectRNSpec(),
877
877
  * @param logicalPageName The logical page name to be set.
878
878
  * @return True if the operation was successful, false otherwise.
879
879
  */
880
+ /**
881
+ * Whether the bridge may touch capture at all.
882
+ *
883
+ * `disable()` reaches `Tealeaf.disable()`, which unregisters the activity
884
+ * lifecycle callbacks and clears the enabled flag — enough on iOS, where
885
+ * `<Connect>` only advances the current screen name. On Android the same
886
+ * component also drives capture explicitly on every navigation
887
+ * (`logScreenViewPageName` + `logScreenLayout`), and those paths used to run
888
+ * regardless of the flag: `setCurrentScreenName` calls through to
889
+ * `Tealeaf.resumeTealeaf`, which resumes logging, and `logScreenLayout`
890
+ * captured a full layout. The net effect was that `disable()` silenced
891
+ * capture on iOS but not on Android, for an app doing nothing unusual.
892
+ *
893
+ * Checked here rather than in JS so every caller is covered, including apps
894
+ * that call the bridge methods directly.
895
+ */
896
+ private fun isCaptureAllowed(): Boolean = Connect.isEnabled()
897
+
880
898
  override fun setCurrentScreenName(logicalPageName: String): Boolean {
899
+ // resumeConnect resumes logging, so this must not run while disabled.
900
+ if (!isCaptureAllowed()) return false
881
901
  val result = resumeConnect(getCurrentActivity(), logicalPageName, false)
882
902
  return result
883
903
  }
@@ -890,8 +910,14 @@ class HybridAcousticConnectRN : HybridAcousticConnectRNSpec(),
890
910
  * @return True if the operation was successful, false otherwise.
891
911
  */
892
912
  override fun logScreenViewContextLoad(logicalPageName: Variant_NullType_String?, referrer: Variant_NullType_String?): Boolean {
893
- val result = logScreenview(getCurrentActivity()!!, logicalPageName?.asSecondOrNull().toString(), ScreenviewType.LOAD, referrer?.asSecondOrNull());
894
- return result
913
+ // Emits a screenview message; nothing should reach the queue while disabled.
914
+ if (!isCaptureAllowed()) return false
915
+ // No activity means nothing to log a screenview against. This used to be
916
+ // a force-unwrap, which turned a backgrounded or not-yet-attached activity
917
+ // into a crash; the sample now calls this method directly, so the path is
918
+ // easy to reach from JS.
919
+ val activity = getCurrentActivity() ?: return false
920
+ return logScreenview(activity, logicalPageName?.asSecondOrNull().toString(), ScreenviewType.LOAD, referrer?.asSecondOrNull())
895
921
  }
896
922
 
897
923
  /**
@@ -902,8 +928,14 @@ class HybridAcousticConnectRN : HybridAcousticConnectRNSpec(),
902
928
  * @return True if the operation was successful, false otherwise.
903
929
  */
904
930
  override fun logScreenViewContextUnload(logicalPageName: Variant_NullType_String?, referrer: Variant_NullType_String?): Boolean {
905
- val result = logScreenview(getCurrentActivity()!!, logicalPageName?.asSecondOrNull().toString(), ScreenviewType.UNLOAD, referrer?.asSecondOrNull());
906
- return result
931
+ // Emits a screenview message; nothing should reach the queue while disabled.
932
+ if (!isCaptureAllowed()) return false
933
+ // No activity means nothing to log a screenview against. This used to be
934
+ // a force-unwrap, which turned a backgrounded or not-yet-attached activity
935
+ // into a crash; the sample now calls this method directly, so the path is
936
+ // easy to reach from JS.
937
+ val activity = getCurrentActivity() ?: return false
938
+ return logScreenview(activity, logicalPageName?.asSecondOrNull().toString(), ScreenviewType.UNLOAD, referrer?.asSecondOrNull())
907
939
  }
908
940
 
909
941
  /**
@@ -917,12 +949,28 @@ class HybridAcousticConnectRN : HybridAcousticConnectRNSpec(),
917
949
  * @return True if the operation was successful, false otherwise.
918
950
  */
919
951
  override fun logScreenLayout(name: String, delay: Double): Boolean {
952
+ // The wrapper calls this on every Android navigation.
953
+ if (!isCaptureAllowed()) return false
954
+ // Advisory on purpose: a false here means the screen name did not advance,
955
+ // which is not a reason to skip the screenview and layout that follow — they
956
+ // are what the caller asked for. Treating it as fatal would suppress capture
957
+ // in cases that capture fine today. The guard inside setCurrentScreenName is
958
+ // redundant against the check above and deliberately left in, so the method
959
+ // stays safe for callers that reach it directly.
920
960
  setCurrentScreenName(name)
961
+ // The 3-arg overload takes a nullable Activity, so this one is safe to pass
962
+ // through — unlike the 4-arg overload the context methods use.
921
963
  logScreenview(getCurrentActivity(), name, ScreenviewType.LOAD)
922
964
  var result = false
923
- if (LayoutUtil.canCaptureUserEvents(null, name)) {
965
+ // The layout capture below needs a real activity: it used to go through
966
+ // Objects.requireNonNull, which threw when the activity had gone away
967
+ // between the check above and here. Skip the capture instead and report
968
+ // false — this runs on every Android navigation, so a throw here is a
969
+ // crash on an ordinary screen change.
970
+ val activity = getCurrentActivity()
971
+ if (activity != null && LayoutUtil.canCaptureUserEvents(null, name)) {
924
972
  result = logScreenLayout(
925
- Objects.requireNonNull<Activity?>(getCurrentActivity()),
973
+ activity,
926
974
  name,
927
975
  resolveCaptureLayoutDelayMs(name, delay),
928
976
  true
package/package.json CHANGED
@@ -230,7 +230,7 @@
230
230
  "source": "src/index",
231
231
  "summary": "react-native ios android tealeaf connect cxa wxca er enhanced-replay",
232
232
  "types": "./lib/typescript/src/index.d.ts",
233
- "version": "19.0.16",
233
+ "version": "19.0.17",
234
234
  "workspaces": [
235
235
  "example",
236
236
  "Examples/bare-workflow"