|
BEHealthKit 1.11
A HealthKit plugin for Unity
|
Methods for reading health data. More...
Read methods for the primary between Unity & the native HealthKit API.
Instance Methods | |
| (void) | - readSamples:fromDate:toDate:resultsHandler: |
| read quantity, category or correlation samples. | |
| (void) | - readCharacteristic:resultsHandler: |
| read a characteristic. | |
| (void) | - readSamplesForWorkoutActivity:fromDate:toDate:resultsHandler: |
| read workout samples | |
| (void) | - readStatisticsForQuantityType:predicate:options:resultsHandler: |
| perform a statistics query | |
| (void) | - readStatisticsCollectionForQuantityType:predicate:options:anchorDate:intervalComponents:resultsHandler: |
| read health statistics collection | |
| (void) | - readDocumentOfType:predicate:limit:sortDescriptors:includeDocumentData:resultsHandler: |
| read health document | |
| (void) | - beginBackgroundObserverQuery: |
| begins a background observer query | |
| - (void) beginBackgroundObserverQuery: | (HKQuantityTypeIdentifier) | identifierString |
Begins an HKAnchoredObjectQuery HKDocumentQuery for the specified data type.
| identifierString | the data type |
| - (void) readCharacteristic: | (HKCharacteristicType *) | characteristic | |
| resultsHandler: | (void(^)(id result, NSError *error)) | resultsHandler |
Characteristics are things that don't change over time, like blood type or birth date.
| characteristic | The characteristic to read. |
| resultsHandler | Called when the query finishes executing. If unsuccessful, error contains information about what went wrong, otherwise it will be set to nil. |
| - (void) readDocumentOfType: | (HKDocumentType *) | documentType | |
| predicate: | (NSPredicate *) | predicate | |
| limit: | (NSUInteger) | limit | |
| sortDescriptors: | (NSArray<NSSortDescriptor *> *) | sortDescriptors | |
| includeDocumentData: | (BOOL) | includeDocumentData | |
| resultsHandler: | (void(^)(id result, BOOL done, NSError *error)) | resultsHandler |
A query that returns a snapshot of all matching documents currently saved in the HealthKit store. See HKDocumentQuery.
| documentType | Currently, only HKDocumentTypeIdentifierCDA is supported. |
| predicate | a predicate that limits the results of the query |
| limit | the maximum number of documents to return |
| sortDescriptors | an array of sort decsriptors |
| includeDocumentData | send true to include all document data. send false to just return a summary. |
| resultsHandler | Called when the query finishes executing. If unsuccessful, error contains information about what went wrong, otherwise it will be set to nil. |
| - (void) readSamples: | (HKSampleType *) | sampleType | |
| fromDate: | (NSDate *) | startDate | |
| toDate: | (NSDate *) | endDate | |
| resultsHandler: | (void(^)(NSArray *results, NSError *error)) | resultsHandler |
Executes a query with -initWithSampleType:predicate:limit:sortDescriptors:resultsHandler:. Limit will be set to no limit, and they will be sorted by startDate, in ascending order.
| sampleType | the type of sample to read. |
| startDate | the starting limit for the query. |
| endDate | the end date. |
| resultsHandler | Called when the query finishes executing. If unsuccessful, error contains information about what went wrong, otherwise it will be set to nil. |
| - (void) readSamplesForWorkoutActivity: | (HKWorkoutActivityType) | activity | |
| fromDate: | (NSDate *) | startDate | |
| toDate: | (NSDate *) | endDate | |
| resultsHandler: | (void(^)(NSArray *results, NSError *error)) | resultsHandler |
...
| activity | The activity type to read. See HKWorkoutActivityType documentation |
| startDate | the starting limit for the query. |
| endDate | the end date. |
| resultsHandler | Called when the query finishes executing. If unsuccessful, error contains information about what went wrong, otherwise it will be set to nil. |
| - (void) readStatisticsCollectionForQuantityType: | (HKQuantityType *) | quantityType | |
| predicate: | (NSPredicate *) | predicate | |
| options: | (HKStatisticsOptions) | options | |
| anchorDate: | (NSDate *) | anchorDate | |
| intervalComponents: | (NSDateComponents *) | interval | |
| resultsHandler: | (void(^)(id result, NSError *error)) | resultsHandler |
A query that performs multiple statistics queries over a series of fixed-length time intervals, and returns the results. See HKStatisticsCollectionQuery
| quantityType | the type of sample to read. |
| predicate | a predicate that limits the results of the query |
| options | a single option that defines the type of calculation to be performed on the data |
| anchorDate | the anchor date for the collection's time intervals |
| interval | the date components that determine the time interval for each statistic in this collection |
| resultsHandler | Called when the query finishes executing. If unsuccessful, error contains information about what went wrong, otherwise it will be set to nil. |
| - (void) readStatisticsForQuantityType: | (HKQuantityType *) | quantityType | |
| predicate: | (NSPredicate *) | predicate | |
| options: | (HKStatisticsOptions) | options | |
| resultsHandler: | (void(^)(id result, NSError *error)) | resultsHandler |
A query that performs statistical calculations over a set of matching quantity samples, and returns the results. See HKStatisticsQuery.
| quantityType | the type of sample to read. |
| predicate | a predicate that limits the results of the query |
| options | a single option that defines the type of calculation to be performed on the data |
| resultsHandler | Called when the query finishes executing. If unsuccessful, error contains information about what went wrong, otherwise it will be set to nil. |