@capillarytech/react-native-hydra-lib 1.7.0-beta.8 → 1.7.0-beta.9

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.
@@ -179,14 +179,14 @@ dependencies {
179
179
  //noinspection GradleDependency
180
180
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
181
181
 
182
- implementation "com.capillarytech:hydra-core:1.9.22-beta08"
183
- implementation "com.capillarytech:hydra-pushbase:1.9.22-beta08"
184
- implementation "com.capillarytech:hydra-firebase:1.9.22-beta08"
185
- implementation "com.capillarytech:hydra-richnotification:1.9.22-beta08"
186
-
187
- implementation "com.capillarytech:hydra-inbox-core:1.9.22-beta08"
188
- implementation "com.capillarytech:hydra-inbox-ui:1.9.22-beta08"
189
- implementation "com.capillarytech:hydra-inapp:1.9.22-beta08"
182
+ implementation "com.capillarytech:hydra-core:1.9.22-beta09"
183
+ implementation "com.capillarytech:hydra-pushbase:1.9.22-beta09"
184
+ implementation "com.capillarytech:hydra-firebase:1.9.22-beta09"
185
+ implementation "com.capillarytech:hydra-richnotification:1.9.22-beta09"
186
+
187
+ implementation "com.capillarytech:hydra-inbox-core:1.9.22-beta09"
188
+ implementation "com.capillarytech:hydra-inbox-ui:1.9.22-beta09"
189
+ implementation "com.capillarytech:hydra-inapp:1.9.22-beta09"
190
190
  implementation "com.google.firebase:firebase-messaging-ktx:24.1.0"
191
191
 
192
192
  implementation "com.google.code.gson:gson:2.11.0"
@@ -921,6 +921,16 @@ object HydraCore {
921
921
  promise?.resolve(hydraAPI!!.isGamificationSuppressed())
922
922
  }
923
923
 
924
+ /** Case/whitespace-tolerant lookup, avoids relying on ThemeMode.valueOf()'s exact-match reflection. */
925
+ private fun parseThemeMode(mode: String): ThemeMode? =
926
+ when (mode.trim().uppercase()) {
927
+ "NONE" -> ThemeMode.NONE
928
+ "AUTO" -> ThemeMode.AUTO
929
+ "LIGHT" -> ThemeMode.LIGHT
930
+ "DARK" -> ThemeMode.DARK
931
+ else -> null
932
+ }
933
+
924
934
  fun setThemeMode(mode: String?, promise: Promise?) {
925
935
  if (mode == null) {
926
936
  Logger.e("HydraCore.setThemeMode", "Theme mode is null")
@@ -928,17 +938,25 @@ object HydraCore {
928
938
  return
929
939
  }
930
940
 
931
- try {
932
- getFlowManager()?.themeMode = ThemeMode.valueOf(mode)
933
- promise?.resolve(null)
934
- } catch (e: IllegalArgumentException) {
941
+ if (hydraAPI == null) {
942
+ Logger.e("HydraCore.setThemeMode", "HydraAPI is null")
943
+ promise?.reject("Error setting theme mode", "HydraAPI is null", Throwable())
944
+ return
945
+ }
946
+
947
+ val themeMode = parseThemeMode(mode)
948
+ if (themeMode == null) {
935
949
  Logger.e("HydraCore.setThemeMode", "Invalid theme mode: $mode")
936
- promise?.reject("Error setting theme mode", "Invalid theme mode: $mode", e)
950
+ promise?.reject("Error setting theme mode", "Invalid theme mode: $mode", Throwable())
951
+ return
937
952
  }
953
+
954
+ hydraAPI!!.setThemeMode(themeMode)
955
+ promise?.resolve(null)
938
956
  }
939
957
 
940
958
  fun getThemeMode(promise: Promise?) {
941
- val mode = getFlowManager()?.themeMode ?: ThemeMode.NONE
959
+ val mode = hydraAPI?.getThemeMode() ?: ThemeMode.NONE
942
960
  promise?.resolve(mode.name)
943
961
  }
944
962
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capillarytech/react-native-hydra-lib",
3
- "version": "1.7.0-beta.8",
3
+ "version": "1.7.0-beta.9",
4
4
  "description": "Library to use Hydra native iOS and Native Android SDKs in React Native",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/commonjs/index.js",
package/sbom.spdx.json CHANGED
@@ -3,12 +3,12 @@
3
3
  "dataLicense": "CC0-1.0",
4
4
  "SPDXID": "SPDXRef-DOCUMENT",
5
5
  "name": "capillarytech-react-native-hydra-lib-sbom",
6
- "documentNamespace": "https://github.com/Capillary/react-native-hydra-lib/sbom-b737ba6c",
6
+ "documentNamespace": "https://github.com/Capillary/react-native-hydra-lib/sbom-4477938f",
7
7
  "creationInfo": {
8
- "created": "2026-09-17T05:51:12.669Z",
8
+ "created": "2026-09-18T09:23:10.491Z",
9
9
  "creators": [
10
10
  "Tool: react-native-hydra-lib-sbom-generator-v1.0.0",
11
- "Tool: @capillarytech/react-native-hydra-lib@1.7.0-beta.7"
11
+ "Tool: @capillarytech/react-native-hydra-lib@1.7.0-beta.8"
12
12
  ],
13
13
  "licenseListVersion": "3.19"
14
14
  },
@@ -21,7 +21,7 @@
21
21
  "licenseConcluded": "MIT",
22
22
  "licenseDeclared": "MIT",
23
23
  "copyrightText": "Copyright (c) Sandesh Jain <sandesh.Jain@capillarytech.com> (https://docs.capillarytech.com/reference/setting-up-react-native-project-for-hydra-sdk)",
24
- "versionInfo": "1.7.0-beta.7",
24
+ "versionInfo": "1.7.0-beta.8",
25
25
  "supplier": "Person: Sandesh Jain <sandesh.Jain@capillarytech.com> (https://docs.capillarytech.com/reference/setting-up-react-native-project-for-hydra-sdk)",
26
26
  "homepage": "https://github.com/Capillary/react-native-hydra-lib#readme",
27
27
  "description": "Library to use Hydra native iOS and Native Android SDKs in React Native",