@sency/react-native-smkit-ui 2.1.4 → 2.1.6

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.
@@ -95,7 +95,7 @@ dependencies {
95
95
  implementation "com.facebook.react:react-android"
96
96
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
97
97
 
98
- implementation("com.sency.smkitui:smkitui:1.5.6") {
98
+ implementation("com.sency.smkitui:smkitui:1.5.7") {
99
99
  exclude group: 'com.facebook.fbjni', module: 'fbjni-java-only'
100
100
  // // Don't exclude native libraries
101
101
  // exclude group: 'com.facebook.react', module: 'react-native'
@@ -187,14 +187,14 @@ class SMKitUIManager: NSObject, RCTBridgeModule {
187
187
  print("SMKitUIManager: Starting workout program")
188
188
  self.onWorkoutDidFinish = onWorkoutDidFinish
189
189
  self.onWorkoutFailed = onWorkoutFailed
190
-
190
+
191
191
  DispatchQueue.main.async { [weak self] in
192
192
  guard let self = self,
193
193
  let smkitUIViewController = self.smkitUIViewController else {
194
194
  onWorkoutFailed("StartWorkoutProgram Failed", "Failed to present view", nil)
195
195
  return
196
196
  }
197
-
197
+
198
198
  guard let json = try? self.stringJsonToDic(stringJSON: rawJson),
199
199
  let week = json["week"] as? Int,
200
200
  let zone = json["bodyZone"] as? String,
@@ -209,8 +209,17 @@ class SMKitUIManager: NSObject, RCTBridgeModule {
209
209
  onWorkoutFailed("StartWorkoutProgram Failed", "Invalid Workout Config", nil)
210
210
  return
211
211
  }
212
-
212
+
213
213
  let language = self.resolveLanguage(rawLanguage)
214
+
215
+ // Set language on the main queue to avoid race conditions with
216
+ // setSessionLanguage/setPhoneCalibrationLanguage called from RN module queue
217
+ SMKitUIModel.setSessionLanguage(language: language)
218
+ SMKitUIModel.setPhoneCalibrationLanguage(language: language)
219
+
220
+ // Process modifications (color theme, phone calibration settings)
221
+ let _ = self.processModifications(modifications)
222
+
214
223
  let config = WorkoutConfig(
215
224
  week: week,
216
225
  bodyZone: bodyZone,
@@ -219,8 +228,7 @@ class SMKitUIManager: NSObject, RCTBridgeModule {
219
228
  language: language,
220
229
  programID: programID
221
230
  )
222
-
223
- // Note: startWorkoutFromProgram doesn't support modifications parameter in SDK 1.4.3
231
+
224
232
  SMKitUIModel.startWorkoutFromProgram(viewController: smkitUIViewController, workoutConfig: config, delegate: self, onFailure: { error in
225
233
  onWorkoutFailed("StartWorkoutProgram Failed", error.localizedDescription, error)
226
234
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sency/react-native-smkit-ui",
3
- "version": "2.1.4",
3
+ "version": "2.1.6",
4
4
  "description": "React Native library for SMKit UI - Advanced fitness assessments and workout programs with AI-powered motion detection and real-time performance tracking",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",