@kingstinct/react-native-healthkit 12.1.0 → 12.1.1

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.
@@ -115,6 +115,9 @@ class CoreModule: HybridCoreModuleSpec {
115
115
 
116
116
  return Promise.async {
117
117
  try await withCheckedThrowingContinuation { continuation in
118
+ if toShare.isEmpty && toRead.isEmpty {
119
+ return continuation.resume(throwing: RuntimeError.error(withMessage: "[react-native-healthkit] Both toRead and toShare are empty, at least one data type must be specified to check authorization status"))
120
+ }
118
121
  store.getRequestStatusForAuthorization(toShare: toShare, read: toRead) { status, error in
119
122
  if let error = error {
120
123
  continuation.resume(throwing: error)
@@ -163,7 +166,7 @@ class CoreModule: HybridCoreModuleSpec {
163
166
  }
164
167
 
165
168
  guard let sources = sources else {
166
- return continuation.resume(throwing: RuntimeError.error(withMessage: "Empty response for sample type \(identifier.stringValue)"))
169
+ return continuation.resume(throwing: RuntimeError.error(withMessage: "[react-native-healthkit] Empty response for sample type \(identifier.stringValue)"))
167
170
  }
168
171
 
169
172
  let serializedSources = sources.map { source -> SourceProxy in
@@ -338,7 +341,7 @@ class CoreModule: HybridCoreModuleSpec {
338
341
 
339
342
  func unsubscribeQuery(queryId: String) throws -> Bool {
340
343
  guard let query = self._runningQueries[queryId] else {
341
- throw RuntimeError.error(withMessage: "Query with id \(queryId) not found")
344
+ throw RuntimeError.error(withMessage: "[react-native-healthkit] Query with id \(queryId) not found")
342
345
  }
343
346
 
344
347
  store.stop(query)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kingstinct/react-native-healthkit",
3
- "version": "12.1.0",
3
+ "version": "12.1.1",
4
4
  "description": "React Native bindings for HealthKit",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",