@kingstinct/react-native-healthkit 4.1.0 → 4.3.0
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.
- package/README.md +1 -1
- package/ios/ReactNativeHealthkit.m +15 -10
- package/ios/ReactNativeHealthkit.swift +364 -175
- package/lib/commonjs/index.ios.js +17 -8
- package/lib/commonjs/index.ios.js.map +1 -1
- package/lib/commonjs/index.js +9 -8
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/native-types.js +17 -1
- package/lib/commonjs/native-types.js.map +1 -1
- package/lib/commonjs/types.js +4 -0
- package/lib/commonjs/types.js.map +1 -1
- package/lib/example/App.js +197 -0
- package/lib/index.ios.js +310 -0
- package/lib/index.js +44 -0
- package/lib/module/index.ios.js +17 -8
- package/lib/module/index.ios.js.map +1 -1
- package/lib/module/index.js +2 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/native-types.js +16 -1
- package/lib/module/native-types.js.map +1 -1
- package/lib/module/types.js +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/native-types.js +447 -0
- package/lib/src/index.ios.js +314 -0
- package/lib/src/index.js +45 -0
- package/lib/src/native-types.js +453 -0
- package/lib/src/types.js +1 -0
- package/lib/types.js +1 -0
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.ios.d.ts +1 -1
- package/lib/typescript/src/native-types.d.ts +29 -1
- package/lib/typescript/src/types.d.ts +3 -1
- package/package.json +8 -7
- package/src/index.ios.tsx +17 -12
- package/src/index.tsx +2 -1
- package/src/native-types.ts +65 -33
- package/src/types.ts +8 -2
- package/ios/.DS_Store +0 -0
- package/ios/ReactNativeHealthkit.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -4
- package/ios/ReactNativeHealthkit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/ios/ReactNativeHealthkit.xcodeproj/project.xcworkspace/xcuserdata/robertherber.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/ReactNativeHealthkit.xcodeproj/xcuserdata/robertherber.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
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
|
|
|
@@ -29,7 +29,7 @@ RCT_EXTERN_METHOD(getBloodType:(RCTPromiseResolveBlock)resolve
|
|
|
29
29
|
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
30
30
|
|
|
31
31
|
RCT_EXTERN_METHOD(getDateOfBirth:(RCTPromiseResolveBlock)resolve
|
|
32
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
32
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
33
33
|
|
|
34
34
|
RCT_EXTERN_METHOD(authorizationStatusFor:(NSString)typeIdentifier
|
|
35
35
|
withResolver:(RCTPromiseResolveBlock)resolve
|
|
@@ -37,19 +37,19 @@ RCT_EXTERN_METHOD(authorizationStatusFor:(NSString)typeIdentifier
|
|
|
37
37
|
|
|
38
38
|
RCT_EXTERN_METHOD(enableBackgroundDelivery:(NSString)typeIdentifier
|
|
39
39
|
updateFrequency:(NSInteger)updateFrequency
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
41
|
+
reject:(RCTPromiseRejectBlock)reject);
|
|
42
42
|
|
|
43
43
|
RCT_EXTERN_METHOD(disableBackgroundDelivery:(NSString)typeIdentifier
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
45
|
+
reject:(RCTPromiseRejectBlock)reject);
|
|
46
46
|
|
|
47
47
|
RCT_EXTERN_METHOD(disableAllBackgroundDelivery:(RCTPromiseResolveBlock)resolve
|
|
48
|
-
|
|
48
|
+
reject:(RCTPromiseRejectBlock)reject);
|
|
49
49
|
|
|
50
50
|
RCT_EXTERN_METHOD(getPreferredUnits:(NSArray)forIdentifiers
|
|
51
|
-
resolve:(RCTPromiseResolveBlock)resolve
|
|
52
|
-
reject:(RCTPromiseRejectBlock)reject)
|
|
51
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
52
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
53
53
|
|
|
54
54
|
|
|
55
55
|
RCT_EXTERN_METHOD(saveQuantitySample:(NSString)typeIdentifier
|
|
@@ -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
|
|
@@ -145,6 +145,11 @@ RCT_EXTERN_METHOD(queryStatisticsForQuantity:(NSString)typeIdentifier
|
|
|
145
145
|
)
|
|
146
146
|
|
|
147
147
|
RCT_EXTERN_METHOD(getWheelchairUse:(RCTPromiseResolveBlock)resolve
|
|
148
|
-
|
|
148
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
149
|
+
|
|
150
|
+
RCT_EXTERN_METHOD(getWorkoutRoutes:(NSString)workoutUUID
|
|
151
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
152
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
153
|
+
)
|
|
149
154
|
|
|
150
155
|
@end
|