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
ca5fd19c
Commit
ca5fd19c
authored
Feb 28, 2018
by
Jackson Tomlinson
Committed by
GitHub
Feb 28, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into feature/moreDailyMethods
parents
dbe6e4b1
7df6845d
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
517 additions
and
9 deletions
+517
-9
Constants/Permissions.js
Constants/Permissions.js
+38
-1
RCTAppleHealthKit/RCTAppleHealthKit+Methods_Dietary.h
RCTAppleHealthKit/RCTAppleHealthKit+Methods_Dietary.h
+16
-0
RCTAppleHealthKit/RCTAppleHealthKit+Methods_Dietary.m
RCTAppleHealthKit/RCTAppleHealthKit+Methods_Dietary.m
+409
-0
RCTAppleHealthKit/RCTAppleHealthKit+TypesAndPermissions.m
RCTAppleHealthKit/RCTAppleHealthKit+TypesAndPermissions.m
+39
-3
RCTAppleHealthKit/RCTAppleHealthKit.m
RCTAppleHealthKit/RCTAppleHealthKit.m
+12
-2
README.md
README.md
+2
-2
package.json
package.json
+1
-1
No files found.
Constants/Permissions.js
View file @
ca5fd19c
...
@@ -16,7 +16,44 @@ export const Permissions = {
...
@@ -16,7 +16,44 @@ export const Permissions = {
BodyMassIndex
:
"
BodyMassIndex
"
,
BodyMassIndex
:
"
BodyMassIndex
"
,
BodyTemperature
:
"
BodyTemperature
"
,
BodyTemperature
:
"
BodyTemperature
"
,
DateOfBirth
:
"
DateOfBirth
"
,
DateOfBirth
:
"
DateOfBirth
"
,
DietaryEnergy
:
"
DietaryEnergy
"
,
Biotin
:
"
Biotin
"
,
Caffeine
:
"
Caffeine
"
,
Calcium
:
"
Calcium
"
,
Carbohydrates
:
"
Carbohydrates
"
,
Chloride
:
"
Chloride
"
,
Cholesterol
:
"
Cholesterol
"
,
Copper
:
"
Copper
"
,
EnergyConsumed
:
"
EnergyConsumed
"
,
FatMonounsaturated
:
"
FatMonounsaturated
"
,
FatPolyunsaturated
:
"
FatPolyunsaturated
"
,
FatSaturated
:
"
FatSaturated
"
,
FatTotal
:
"
FatTotal
"
,
Fiber
:
"
Fiber
"
,
Folate
:
"
Folate
"
,
Iodine
:
"
Iodine
"
,
Iron
:
"
Iron
"
,
Magnesium
:
"
Magnesium
"
,
Manganese
:
"
Manganese
"
,
Molybdenum
:
"
Molybdenum
"
,
Niacin
:
"
Niacin
"
,
PantothenicAcid
:
"
PantothenicAcid
"
,
Phosphorus
:
"
Phosphorus
"
,
Potassium
:
"
Potassium
"
,
Protein
:
"
Protein
"
,
Riboflavin
:
"
Riboflavin
"
,
Selenium
:
"
Selenium
"
,
Sodium
:
"
Sodium
"
,
Sugar
:
"
Sugar
"
,
Thiamin
:
"
Thiamin
"
,
VitaminA
:
"
VitaminA
"
,
VitaminB12
:
"
VitaminB12
"
,
VitaminB6
:
"
VitaminB6
"
,
VitaminC
:
"
VitaminC
"
,
VitaminD
:
"
VitaminD
"
,
VitaminE
:
"
VitaminE
"
,
VitaminK
:
"
VitaminK
"
,
Zinc
:
"
Zinc
"
,
Water
:
"
Water
"
,
DistanceCycling
:
"
DistanceCycling
"
,
DistanceCycling
:
"
DistanceCycling
"
,
DistanceWalkingRunning
:
"
DistanceWalkingRunning
"
,
DistanceWalkingRunning
:
"
DistanceWalkingRunning
"
,
FlightsClimbed
:
"
FlightsClimbed
"
,
FlightsClimbed
:
"
FlightsClimbed
"
,
...
...
RCTAppleHealthKit/RCTAppleHealthKit+Methods_Dietary.h
0 → 100644
View file @
ca5fd19c
//
// RCTAppleHealthKit+Methods_Dietary.h
// RCTAppleHealthKit
//
// Created by Greg Wilson on 2016-06-26.
// Copyright © 2016 Greg Wilson. All rights reserved.
//
#import "RCTAppleHealthKit.h"
@interface
RCTAppleHealthKit
(
Methods_Dietary
)
-
(
void
)
saveFood
:(
NSDictionary
*
)
input
callback
:(
RCTResponseSenderBlock
)
callback
;
-
(
void
)
saveWater
:(
NSDictionary
*
)
input
callback
:(
RCTResponseSenderBlock
)
callback
;
@end
RCTAppleHealthKit/RCTAppleHealthKit+Methods_Dietary.m
0 → 100644
View file @
ca5fd19c
This diff is collapsed.
Click to expand it.
RCTAppleHealthKit/RCTAppleHealthKit+TypesAndPermissions.m
View file @
ca5fd19c
...
@@ -3,8 +3,7 @@
...
@@ -3,8 +3,7 @@
// RCTAppleHealthKit
// RCTAppleHealthKit
//
//
// Created by Greg Wilson on 2016-06-26.
// Created by Greg Wilson on 2016-06-26.
// This source code is licensed under the MIT-style license found in the
// Copyright © 2016 Greg Wilson. All rights reserved.
// LICENSE file in the root directory of this source tree.
//
//
#import "RCTAppleHealthKit+TypesAndPermissions.h"
#import "RCTAppleHealthKit+TypesAndPermissions.h"
...
@@ -73,7 +72,44 @@
...
@@ -73,7 +72,44 @@
@"ActiveEnergyBurned"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierActiveEnergyBurned
],
@"ActiveEnergyBurned"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierActiveEnergyBurned
],
@"FlightsClimbed"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierFlightsClimbed
],
@"FlightsClimbed"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierFlightsClimbed
],
// Nutrition Identifiers
// Nutrition Identifiers
@"DietaryEnergy"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietaryEnergyConsumed
],
@"Biotin"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietaryBiotin
],
@"Caffeine"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietaryCaffeine
],
@"Calcium"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietaryCalcium
],
@"Carbohydrates"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietaryCarbohydrates
],
@"Chloride"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietaryChloride
],
@"Cholesterol"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietaryCholesterol
],
@"Copper"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietaryCopper
],
@"EnergyConsumed"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietaryEnergyConsumed
],
@"FatMonounsaturated"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietaryFatMonounsaturated
],
@"FatPolyunsaturated"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietaryFatPolyunsaturated
],
@"FatSaturated"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietaryFatSaturated
],
@"FatTotal"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietaryFatTotal
],
@"Fiber"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietaryFiber
],
@"Folate"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietaryFolate
],
@"Iodine"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietaryIodine
],
@"Iron"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietaryIron
],
@"Magnesium"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietaryMagnesium
],
@"Manganese"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietaryManganese
],
@"Molybdenum"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietaryMolybdenum
],
@"Niacin"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietaryNiacin
],
@"PantothenicAcid"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietaryPantothenicAcid
],
@"Phosphorus"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietaryPhosphorus
],
@"Potassium"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietaryPotassium
],
@"Protein"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietaryProtein
],
@"Riboflavin"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietaryRiboflavin
],
@"Selenium"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietarySelenium
],
@"Sodium"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietarySodium
],
@"Sugar"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietarySugar
],
@"Thiamin"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietaryThiamin
],
@"VitaminA"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietaryVitaminA
],
@"VitaminB12"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietaryVitaminB12
],
@"VitaminB6"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietaryVitaminB6
],
@"VitaminC"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietaryVitaminC
],
@"VitaminD"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietaryVitaminD
],
@"VitaminE"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietaryVitaminE
],
@"VitaminK"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietaryVitaminK
],
@"Zinc"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietaryZinc
],
@"Water"
:
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierDietaryWater
],
// Sleep
// Sleep
@"SleepAnalysis"
:
[
HKObjectType
categoryTypeForIdentifier
:
HKCategoryTypeIdentifierSleepAnalysis
],
@"SleepAnalysis"
:
[
HKObjectType
categoryTypeForIdentifier
:
HKCategoryTypeIdentifierSleepAnalysis
],
// Mindfulness
// Mindfulness
...
...
RCTAppleHealthKit/RCTAppleHealthKit.m
View file @
ca5fd19c
...
@@ -3,8 +3,7 @@
...
@@ -3,8 +3,7 @@
// RCTAppleHealthKit
// RCTAppleHealthKit
//
//
// Created by Greg Wilson on 2016-06-26.
// Created by Greg Wilson on 2016-06-26.
// This source code is licensed under the MIT-style license found in the
// Copyright © 2016 Greg Wilson. All rights reserved.
// LICENSE file in the root directory of this source tree.
//
//
#import "RCTAppleHealthKit.h"
#import "RCTAppleHealthKit.h"
...
@@ -13,6 +12,7 @@
...
@@ -13,6 +12,7 @@
#import "RCTAppleHealthKit+Methods_Activity.h"
#import "RCTAppleHealthKit+Methods_Activity.h"
#import "RCTAppleHealthKit+Methods_Body.h"
#import "RCTAppleHealthKit+Methods_Body.h"
#import "RCTAppleHealthKit+Methods_Fitness.h"
#import "RCTAppleHealthKit+Methods_Fitness.h"
#import "RCTAppleHealthKit+Methods_Dietary.h"
#import "RCTAppleHealthKit+Methods_Characteristic.h"
#import "RCTAppleHealthKit+Methods_Characteristic.h"
#import "RCTAppleHealthKit+Methods_Vitals.h"
#import "RCTAppleHealthKit+Methods_Vitals.h"
#import "RCTAppleHealthKit+Methods_Results.h"
#import "RCTAppleHealthKit+Methods_Results.h"
...
@@ -147,6 +147,16 @@ RCT_EXPORT_METHOD(getDailyFlightsClimbedSamples:(NSDictionary *)input callback:(
...
@@ -147,6 +147,16 @@ RCT_EXPORT_METHOD(getDailyFlightsClimbedSamples:(NSDictionary *)input callback:(
[
self
fitness_getDailyFlightsClimbedSamples
:
input
callback
:
callback
];
[
self
fitness_getDailyFlightsClimbedSamples
:
input
callback
:
callback
];
}
}
RCT_EXPORT_METHOD
(
saveFood
:
(
NSDictionary
*
)
input
callback
:
(
RCTResponseSenderBlock
)
callback
)
{
[
self
saveFood
:
input
callback
:
callback
];
}
RCT_EXPORT_METHOD
(
saveWater
:
(
NSDictionary
*
)
input
callback
:
(
RCTResponseSenderBlock
)
callback
)
{
[
self
saveWater
:
input
callback
:
callback
];
}
RCT_EXPORT_METHOD
(
getHeartRateSamples
:
(
NSDictionary
*
)
input
callback
:
(
RCTResponseSenderBlock
)
callback
)
RCT_EXPORT_METHOD
(
getHeartRateSamples
:
(
NSDictionary
*
)
input
callback
:
(
RCTResponseSenderBlock
)
callback
)
{
{
[
self
vitals_getHeartRateSamples
:
input
callback
:
callback
];
[
self
vitals_getHeartRateSamples
:
input
callback
:
callback
];
...
...
README.md
View file @
ca5fd19c
...
@@ -44,8 +44,8 @@ If new read/write permissions are added to the options object then the app user
...
@@ -44,8 +44,8 @@ If new read/write permissions are added to the options object then the app user
```
javascript
```
javascript
let
options
=
{
let
options
=
{
permissions
:
{
permissions
:
{
read
:
[
"
Height
"
,
"
Weight
"
,
"
StepCount
"
,
"
DateOfBirth
"
,
"
BodyMassIndex
"
],
read
:
[
"
Height
"
,
"
Weight
"
,
"
StepCount
"
,
"
DateOfBirth
"
,
"
BodyMassIndex
"
,
"
ActiveEnergyBurned
"
],
write
:
[
"
Weight
"
,
"
StepCount
"
,
"
BodyMassIndex
"
]
write
:
[
"
Height
"
,
"
Weight
"
,
"
StepCount
"
,
"
BodyMassIndex
"
,
"
Biotin
"
,
"
Caffeine
"
,
"
Calcium
"
,
"
Carbohydrates
"
,
"
Chloride
"
,
"
Cholesterol
"
,
"
Copper
"
,
"
EnergyConsumed
"
,
"
FatMonounsaturated
"
,
"
FatPolyunsaturated
"
,
"
FatSaturated
"
,
"
FatTotal
"
,
"
Fiber
"
,
"
Folate
"
,
"
Iodine
"
,
"
Iron
"
,
"
Magnesium
"
,
"
Manganese
"
,
"
Molybdenum
"
,
"
Niacin
"
,
"
PantothenicAcid
"
,
"
Phosphorus
"
,
"
Potassium
"
,
"
Protein
"
,
"
Riboflavin
"
,
"
Selenium
"
,
"
Sodium
"
,
"
Sugar
"
,
"
Thiamin
"
,
"
VitaminA
"
,
"
VitaminB12
"
,
"
VitaminB6
"
,
"
VitaminC
"
,
"
VitaminD
"
,
"
VitaminE
"
,
"
VitaminK
"
,
"
Zinc
"
,
"
Water
"
]
}
}
};
};
```
```
...
...
package.json
View file @
ca5fd19c
{
{
"name"
:
"rn-apple-healthkit"
,
"name"
:
"rn-apple-healthkit"
,
"version"
:
"0.6.
2
"
,
"version"
:
"0.6.
3
"
,
"description"
:
"A React Native package for interacting with Apple HealthKit"
,
"description"
:
"A React Native package for interacting with Apple HealthKit"
,
"main"
:
"index.js"
,
"main"
:
"index.js"
,
"repository"
:
{
"repository"
:
{
...
...
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