Commit d2a9ce05 authored by Evgenii Evstropov's avatar Evgenii Evstropov

add support for more information and fix isTracked flag

parent c3b53243
......@@ -138,9 +138,9 @@
NSString *startDateString = [RCTAppleHealthKit buildISO8601StringFromDate:sample.startDate];
NSString *endDateString = [RCTAppleHealthKit buildISO8601StringFromDate:sample.endDate];
bool isTracked = true;
for(id key in [sample metadata])
if (key == HKMetadataKeyWasUserEntered ) {
if ([[sample metadata][HKMetadataKeyWasUserEntered] intValue] == 1) {
isTracked = false;
}
......@@ -148,6 +148,9 @@
@"type" : type,
@"energy" : @(energy),
@"isTracked" : @(isTracked),
@"sourceName" : [[[sample sourceRevision] source] name],
@"sourceBundleId" : [[[sample sourceRevision] source] bundleIdentifier],
@"device": [[sample sourceRevision] productType],
@"distance" : @(distance),
@"startDate" : startDateString,
@"endDate" : endDateString
......@@ -164,14 +167,16 @@
NSString *endDateString = [RCTAppleHealthKit buildISO8601StringFromDate:sample.endDate];
bool isTracked = true;
for(id key in [sample metadata])
if (key == HKMetadataKeyWasUserEntered ) {
if ([[sample metadata][HKMetadataKeyWasUserEntered] intValue] == 1) {
isTracked = false;
}
NSDictionary *elem = @{
@"value" : @(value),
@"isTracked" : @(isTracked),
@"sourceName" : [[[sample sourceRevision] source] name],
@"sourceBundleId" : [[[sample sourceRevision] source] bundleIdentifier],
@"device": [[sample sourceRevision] productType],
@"startDate" : startDateString,
@"endDate" : endDateString
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment