Conversation
There was a problem hiding this comment.
Pull request overview
Updates the HealthKit plugin to persist the sensor label into recorded sample payloads (instead of always emitting an empty string), and introduces a helper API to update last-fetch timestamps for a provided set of HealthKit types.
Changes:
- Populate
labelin saved HealthKit quantity and category records when available. - Add
setLastFetchTime:withHKDataTypes:to set per-type last record timestamps for a provided set of HK types. - Bump podspec version to
1.14.19.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| AWAREFramework/Classes/Plugins/HealthKit/AWAREHealthKitQuantity.m | Writes label into quantity sample dictionaries when non-nil. |
| AWAREFramework/Classes/Plugins/HealthKit/AWAREHealthKitCategory.m | Writes label into category sample dictionaries when non-nil. |
| AWAREFramework/Classes/Plugins/HealthKit/AWAREHealthKit.m | Adds helper to set last fetch time for a set of HealthKit types. |
| AWAREFramework/Classes/Plugins/HealthKit/AWAREHealthKit.h | Exposes the new helper method in the public header. |
| AWAREFramework.podspec | Increments framework version. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - (void) setLastFetchTime:(NSDate * _Nullable)date withHKDataTypes:(NSSet *) types { | ||
| for (HKQuantityType * set in types) { | ||
| if(set.identifier == nil){ | ||
| continue; | ||
| } | ||
| [self setLastRecordTime:date withHKDataType:set.identifier]; | ||
| } |
There was a problem hiding this comment.
setLastFetchTime:withHKDataTypes: enumerates HKQuantityType * even though the types set can include category/workout types (and the method name suggests any HK data type). This is inconsistent with readDataWithDataTypes: (which uses HKSampleType *) and makes the API easy to misuse. Iterate over HKObjectType */HKSampleType * (or validate element classes) and consider renaming the loop variable from set to something like dataType for clarity.
| */ | ||
| // - (void) setLastRecordTime:(NSDate * _Nonnull)date withHKDataType:(NSString * _Nonnull)type; | ||
|
|
||
| - (void) setLastFetchTime:(NSDate * _Nullable)date withHKDataTypes:(NSSet *) types; |
There was a problem hiding this comment.
The new public method setLastFetchTime:withHKDataTypes: takes an untyped NSSet * parameter, which makes it unclear what callers are allowed to pass (and can lead to runtime errors if elements don’t respond to identifier). Consider tightening the signature (e.g., NSSet<HKSampleType *> * / NSSet<HKObjectType *> *) and adding the necessary forward declaration/import so the contract is explicit for API consumers.
No description provided.