@kingstinct/react-native-healthkit 4.2.0 → 4.4.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.
Files changed (69) hide show
  1. package/README.md +1 -1
  2. package/ios/ReactNativeHealthkit.m +6 -1
  3. package/ios/ReactNativeHealthkit.swift +365 -176
  4. package/lib/commonjs/index.ios.js +129 -105
  5. package/lib/commonjs/index.ios.js.map +1 -1
  6. package/lib/commonjs/index.js +58 -44
  7. package/lib/commonjs/index.js.map +1 -1
  8. package/lib/commonjs/native-types.js +136 -106
  9. package/lib/commonjs/native-types.js.map +1 -1
  10. package/lib/commonjs/types.js +4 -0
  11. package/lib/commonjs/types.js.map +1 -1
  12. package/lib/example/App.js +197 -0
  13. package/lib/index.ios.js +310 -0
  14. package/lib/index.js +44 -0
  15. package/lib/module/index.ios.js +130 -106
  16. package/lib/module/index.ios.js.map +1 -1
  17. package/lib/module/index.js +52 -37
  18. package/lib/module/index.js.map +1 -1
  19. package/lib/module/native-types.js +127 -104
  20. package/lib/module/native-types.js.map +1 -1
  21. package/lib/module/types.js +1 -1
  22. package/lib/module/types.js.map +1 -1
  23. package/lib/native-types.js +447 -0
  24. package/lib/src/index.ios.js +314 -0
  25. package/lib/src/index.js +45 -0
  26. package/lib/src/native-types.js +453 -0
  27. package/lib/src/types.js +1 -0
  28. package/lib/types.js +1 -0
  29. package/lib/typescript/src/index.d.ts +1 -1
  30. package/lib/typescript/src/index.ios.d.ts +1 -1
  31. package/lib/typescript/src/native-types.d.ts +458 -205
  32. package/lib/typescript/src/types.d.ts +87 -81
  33. package/package.json +21 -35
  34. package/src/index.ios.tsx +303 -269
  35. package/src/index.tsx +63 -45
  36. package/src/native-types.ts +318 -290
  37. package/src/types.ts +120 -105
  38. package/.DS_Store +0 -0
  39. package/.circleci/config.yml +0 -98
  40. package/.editorconfig +0 -15
  41. package/.gitattributes +0 -3
  42. package/.github/workflows/main.yml +0 -32
  43. package/.gitignore +0 -60
  44. package/CONTRIBUTING.md +0 -184
  45. package/babel.config.js +0 -3
  46. package/example-expo/.expo/README.md +0 -15
  47. package/example-expo/.expo/devices.json +0 -8
  48. package/example-expo/.expo/packager-info.json +0 -5
  49. package/example-expo/.expo/settings.json +0 -9
  50. package/example-expo/.expo-shared/assets.json +0 -4
  51. package/example-expo/.gitignore +0 -14
  52. package/example-expo/App.tsx +0 -376
  53. package/example-expo/app.json +0 -43
  54. package/example-expo/assets/adaptive-icon.png +0 -0
  55. package/example-expo/assets/favicon.png +0 -0
  56. package/example-expo/assets/icon.png +0 -0
  57. package/example-expo/assets/splash.png +0 -0
  58. package/example-expo/babel.config.js +0 -8
  59. package/example-expo/build-1653040579600.ipa +0 -0
  60. package/example-expo/build-1653041063216.ipa +0 -0
  61. package/example-expo/eas.json +0 -18
  62. package/example-expo/package.json +0 -32
  63. package/example-expo/tsconfig.json +0 -6
  64. package/example-expo/yarn.lock +0 -6857
  65. package/lib/typescript/example-expo/App.d.ts +0 -3
  66. package/lib/typescript/src/__tests__/index.test.d.ts +0 -0
  67. package/src/__tests__/index.test.tsx +0 -1
  68. package/tsconfig.json +0 -27
  69. package/yarn.lock +0 -10241
package/README.md CHANGED
@@ -30,7 +30,7 @@ cd ios
30
30
  pod install
31
31
  ```
32
32
 
33
- Remember to set `NSHealthUpdateUsageDescription` and `NSHealthShareUsageDescription` in your `Info.plist` as well as enable the HealthKit capability for the project in Xcode. During runtime you need to check if HealthKit is available on the device with `isHealthDataAvailable` and request permissions with `requestAuthorization`;
33
+ Remember to set `NSHealthUpdateUsageDescription` and `NSHealthShareUsageDescription` in your `Info.plist` as well as enable the HealthKit capability for the project in Xcode. During runtime you need to check if HealthKit is available on the device with `isHealthDataAvailable` and request permissions with `requestAuthorization`. The example has been migrated to **Expo** for easy-of-use and maintainability. See the [example app.json](https://github.com/Kingstinct/react-native-healthkit/blob/8e82d921f57c9bc0912af5f52f53c181ee8e4b5a/example/app.json#L24-L31) for how to apply this to your project. Just keep in mind this will not work in Expo Go since there is native iOS code involved - you'll have to use EAS to [build your own client](https://docs.expo.dev/development/getting-started/).
34
34
 
35
35
  Since this package is using Swift you might also need to add a bridging header in your project if you haven't already, you can [find more about that in the official React Native docs](https://reactnative.dev/docs/native-modules-ios#exporting-swift)
36
36
 
@@ -85,7 +85,7 @@ RCT_EXTERN_METHOD(queryWorkoutSamples:(NSString)energyUnitString
85
85
  resolve:(RCTPromiseResolveBlock)resolve
86
86
  reject:(RCTPromiseRejectBlock)reject
87
87
  )
88
-
88
+
89
89
  RCT_EXTERN_METHOD(queryCategorySamples:(NSString)typeIdentifier
90
90
  from:(NSDate)from
91
91
  to:(NSDate)to
@@ -147,4 +147,9 @@ RCT_EXTERN_METHOD(queryStatisticsForQuantity:(NSString)typeIdentifier
147
147
  RCT_EXTERN_METHOD(getWheelchairUse:(RCTPromiseResolveBlock)resolve
148
148
  withRejecter:(RCTPromiseRejectBlock)reject)
149
149
 
150
+ RCT_EXTERN_METHOD(getWorkoutRoutes:(NSString)workoutUUID
151
+ resolve:(RCTPromiseResolveBlock)resolve
152
+ reject:(RCTPromiseRejectBlock)reject
153
+ )
154
+
150
155
  @end