@@ -39,15 +39,7 @@ class BranchConfigurationController {
3939 * @return Boolean indicating if test mode is enabled
4040 */
4141 private fun isTestModeEnabled (): Boolean {
42- return Branch .getInstance()?.prefHelper_?.getBool(PrefHelper .KEY_TEST_MODE ) ? : false
43- }
44-
45- /* *
46- * Sets whether tracking is disabled.
47- * This flag is used to track if the app has disabled tracking.
48- */
49- fun setTrackingDisabled (disabled : Boolean ) {
50- Branch .getInstance().prefHelper_.setBool(" bnc_tracking_disabled" , disabled)
42+ return BranchUtil .isTestModeEnabled()
5143 }
5244
5345 /* *
@@ -68,6 +60,26 @@ class BranchConfigurationController {
6860 return Branch .getInstance().prefHelper_.getBool(" bnc_instant_deep_linking_enabled" )
6961 }
7062
63+ /* *
64+ * Sets whether plugin runtime initialization should be deferred.
65+ * This is used for cross-process communication scenarios like React Native,
66+ * where we need to wait for the plugin to signal when it's ready before initializing.
67+ *
68+ * @param deferred Boolean indicating if plugin runtime initialization should be deferred
69+ */
70+ fun setDeferInitForPluginRuntime (deferred : Boolean ) {
71+ Branch .getInstance()?.prefHelper_?.setBool(" bnc_defer_init_for_plugin_runtime" , deferred)
72+ }
73+
74+ /* *
75+ * Gets whether plugin runtime initialization is deferred.
76+ *
77+ * @return Boolean indicating if plugin runtime initialization is deferred
78+ */
79+ private fun isDeferInitForPluginRuntime (): Boolean {
80+ return Branch .getInstance().prefHelper_.getBool(" bnc_defer_init_for_plugin_runtime" )
81+ }
82+
7183 /* *
7284 * Serializes the current configuration state into a JSONObject.
7385 * This is used to send configuration data to the server.
@@ -77,13 +89,14 @@ class BranchConfigurationController {
7789 fun serializeConfiguration (): JSONObject {
7890 return try {
7991 JSONObject ().apply {
80- put(\" expectDelayedSessionInitialization\" , getDelayedSessionInitUsed())
81- put(\" testMode\" , isTestModeEnabled())
82- put(\" trackingDisabled\" , isTrackingDisabled())
83- put(\" instantDeepLinkingEnabled\" , isInstantDeepLinkingEnabled())
92+ put(" expectDelayedSessionInitialization" , getDelayedSessionInitUsed())
93+ put(" testMode" , isTestModeEnabled())
94+ put(" trackingDisabled" , isTrackingDisabled())
95+ put(" instantDeepLinkingEnabled" , isInstantDeepLinkingEnabled())
96+ put(" deferInitForPluginRuntime" , isDeferInitForPluginRuntime())
8497 }
8598 } catch (e: Exception ) {
86- BranchLogger.w(\ " Error serializing configuration: ${e.message} \ " )
99+ BranchLogger .w(" Error serializing configuration: ${e.message} " )
87100 JSONObject ()
88101 }
89102 }
0 commit comments