Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rn-apple-healthkit
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Jira
Jira
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ym
rn-apple-healthkit
Commits
836ee64f
Commit
836ee64f
authored
Apr 24, 2018
by
Evgenii Evstropov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add more units
parent
a28741e4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
54 deletions
+9
-54
RCTAppleHealthKit/RCTAppleHealthKit+Methods_Body.m
RCTAppleHealthKit/RCTAppleHealthKit+Methods_Body.m
+0
-1
RCTAppleHealthKit/RCTAppleHealthKit+Utils.h
RCTAppleHealthKit/RCTAppleHealthKit+Utils.h
+0
-1
RCTAppleHealthKit/RCTAppleHealthKit+Utils.m
RCTAppleHealthKit/RCTAppleHealthKit+Utils.m
+9
-52
No files found.
RCTAppleHealthKit/RCTAppleHealthKit+Methods_Body.m
View file @
836ee64f
...
@@ -32,7 +32,6 @@
...
@@ -32,7 +32,6 @@
else
{
else
{
// Determine the weight in the required unit.
// Determine the weight in the required unit.
double
usersWeight
=
[
mostRecentQuantity
doubleValueForUnit
:
unit
];
double
usersWeight
=
[
mostRecentQuantity
doubleValueForUnit
:
unit
];
NSDictionary
*
response
=
@{
NSDictionary
*
response
=
@{
@"value"
:
@
(
usersWeight
),
@"value"
:
@
(
usersWeight
),
@"startDate"
:
[
RCTAppleHealthKit
buildISO8601StringFromDate
:
startDate
],
@"startDate"
:
[
RCTAppleHealthKit
buildISO8601StringFromDate
:
startDate
],
...
...
RCTAppleHealthKit/RCTAppleHealthKit+Utils.h
View file @
836ee64f
...
@@ -22,7 +22,6 @@
...
@@ -22,7 +22,6 @@
+
(
NSDate
*
)
startDateFromOptions
:(
NSDictionary
*
)
options
;
+
(
NSDate
*
)
startDateFromOptions
:(
NSDictionary
*
)
options
;
+
(
NSDate
*
)
endDateFromOptions
:(
NSDictionary
*
)
options
;
+
(
NSDate
*
)
endDateFromOptions
:(
NSDictionary
*
)
options
;
+
(
NSDate
*
)
endDateFromOptionsDefaultNow
:(
NSDictionary
*
)
options
;
+
(
NSDate
*
)
endDateFromOptionsDefaultNow
:(
NSDictionary
*
)
options
;
+
(
HKUnit
*
)
hkUnitFromOptions
:(
NSDictionary
*
)
options
;
+
(
HKUnit
*
)
hkUnitFromOptions
:(
NSDictionary
*
)
options
key
:(
NSString
*
)
key
withDefault
:(
HKUnit
*
)
defaultValue
;
+
(
HKUnit
*
)
hkUnitFromOptions
:(
NSDictionary
*
)
options
key
:(
NSString
*
)
key
withDefault
:(
HKUnit
*
)
defaultValue
;
+
(
NSUInteger
)
uintFromOptions
:(
NSDictionary
*
)
options
key
:(
NSString
*
)
key
withDefault
:(
NSUInteger
)
defaultValue
;
+
(
NSUInteger
)
uintFromOptions
:(
NSDictionary
*
)
options
key
:(
NSString
*
)
key
withDefault
:(
NSUInteger
)
defaultValue
;
...
...
RCTAppleHealthKit/RCTAppleHealthKit+Utils.m
View file @
836ee64f
...
@@ -123,58 +123,6 @@
...
@@ -123,58 +123,6 @@
return
date
;
return
date
;
}
}
// ==========
// DEPRECATED
// ==========
+
(
HKUnit
*
)
hkUnitFromOptions
:(
NSDictionary
*
)
options
{
NSString
*
unitString
=
[
options
objectForKey
:
@"unit"
];
HKUnit
*
theUnit
;
if
([
unitString
isEqualToString
:
@"gram"
]){
theUnit
=
[
HKUnit
gramUnit
];
}
if
([
unitString
isEqualToString
:
@"pound"
]){
theUnit
=
[
HKUnit
poundUnit
];
}
if
([
unitString
isEqualToString
:
@"meter"
]){
theUnit
=
[
HKUnit
meterUnit
];
}
if
([
unitString
isEqualToString
:
@"mile"
]){
theUnit
=
[
HKUnit
mileUnit
];
}
if
([
unitString
isEqualToString
:
@"inch"
]){
theUnit
=
[
HKUnit
inchUnit
];
}
if
([
unitString
isEqualToString
:
@"foot"
]){
theUnit
=
[
HKUnit
footUnit
];
}
if
([
unitString
isEqualToString
:
@"second"
]){
theUnit
=
[
HKUnit
secondUnit
];
}
if
([
unitString
isEqualToString
:
@"minute"
]){
theUnit
=
[
HKUnit
minuteUnit
];
}
if
([
unitString
isEqualToString
:
@"hour"
]){
theUnit
=
[
HKUnit
hourUnit
];
}
if
([
unitString
isEqualToString
:
@"day"
]){
theUnit
=
[
HKUnit
dayUnit
];
}
if
([
unitString
isEqualToString
:
@"joule"
]){
theUnit
=
[
HKUnit
jouleUnit
];
}
if
([
unitString
isEqualToString
:
@"calorie"
]){
theUnit
=
[
HKUnit
calorieUnit
];
}
if
([
unitString
isEqualToString
:
@"count"
]){
theUnit
=
[
HKUnit
countUnit
];
}
if
([
unitString
isEqualToString
:
@"percent"
]){
theUnit
=
[
HKUnit
percentUnit
];
}
return
theUnit
;
}
+
(
HKUnit
*
)
hkUnitFromOptions
:(
NSDictionary
*
)
options
key
:(
NSString
*
)
key
withDefault
:(
HKUnit
*
)
defaultValue
{
+
(
HKUnit
*
)
hkUnitFromOptions
:(
NSDictionary
*
)
options
key
:(
NSString
*
)
key
withDefault
:(
HKUnit
*
)
defaultValue
{
NSString
*
unitString
=
[
options
objectForKey
:
key
];
NSString
*
unitString
=
[
options
objectForKey
:
key
];
...
@@ -183,12 +131,21 @@
...
@@ -183,12 +131,21 @@
if
([
unitString
isEqualToString
:
@"gram"
]){
if
([
unitString
isEqualToString
:
@"gram"
]){
theUnit
=
[
HKUnit
gramUnit
];
theUnit
=
[
HKUnit
gramUnit
];
}
}
if
([
unitString
isEqualToString
:
@"kg"
]){
theUnit
=
[
HKUnit
gramUnitWithMetricPrefix
:
HKMetricPrefixKilo
];
}
if
([
unitString
isEqualToString
:
@"stone"
]){
theUnit
=
[
HKUnit
stoneUnit
];
}
if
([
unitString
isEqualToString
:
@"pound"
]){
if
([
unitString
isEqualToString
:
@"pound"
]){
theUnit
=
[
HKUnit
poundUnit
];
theUnit
=
[
HKUnit
poundUnit
];
}
}
if
([
unitString
isEqualToString
:
@"meter"
]){
if
([
unitString
isEqualToString
:
@"meter"
]){
theUnit
=
[
HKUnit
meterUnit
];
theUnit
=
[
HKUnit
meterUnit
];
}
}
if
([
unitString
isEqualToString
:
@"cm"
]){
theUnit
=
[
HKUnit
meterUnitWithMetricPrefix
:
HKMetricPrefixCenti
];
}
if
([
unitString
isEqualToString
:
@"inch"
]){
if
([
unitString
isEqualToString
:
@"inch"
]){
theUnit
=
[
HKUnit
inchUnit
];
theUnit
=
[
HKUnit
inchUnit
];
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment