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
a36f2331
Commit
a36f2331
authored
Jul 09, 2016
by
Greg Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed Constants.Permissions to remove Read/Write objects, updated StepsDemo
parent
1318fe99
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
72 deletions
+37
-72
constants.js
constants.js
+19
-36
examples/StepsDemo/app/components/home/index.js
examples/StepsDemo/app/components/home/index.js
+6
-24
examples/StepsDemo/ios/StepsDemo.xcodeproj/project.pbxproj
examples/StepsDemo/ios/StepsDemo.xcodeproj/project.pbxproj
+12
-12
No files found.
constants.js
View file @
a36f2331
'
use strict
'
'
use strict
'
const
PERMISSIONS
=
{
const
PERMISSIONS
=
{
READ
:
{
DateOfBirth
:
'
DateOfBirth
'
,
DateOfBirth
:
'
DateOfBirth
'
,
BiologicalSex
:
'
BiologicalSex
'
,
BiologicalSex
:
'
BiologicalSex
'
,
Height
:
'
Height
'
,
Height
:
'
Height
'
,
...
@@ -20,23 +19,6 @@ const PERMISSIONS = {
...
@@ -20,23 +19,6 @@ const PERMISSIONS = {
NikeFuel
:
'
NikeFuel
'
,
NikeFuel
:
'
NikeFuel
'
,
AppleExerciseTime
:
'
AppleExerciseTime
'
,
AppleExerciseTime
:
'
AppleExerciseTime
'
,
DietaryEnergy
:
'
DietaryEnergy
'
,
DietaryEnergy
:
'
DietaryEnergy
'
,
},
WRITE
:
{
Height
:
'
Height
'
,
Weight
:
'
Weight
'
,
BodyMass
:
'
BodyMass
'
,
BodyFatPercentage
:
'
BodyFatPercentage
'
,
BodyMassIndex
:
'
BodyMassIndex
'
,
LeanBodyMass
:
'
LeanBodyMass
'
,
Steps
:
'
Steps
'
,
StepCount
:
'
StepCount
'
,
DistanceWalkingRunning
:
'
DistanceWalkingRunning
'
,
DistanceCycling
:
'
DistanceCycling
'
,
BasalEnergyBurned
:
'
BasalEnergyBurned
'
,
ActiveEnergyBurned
:
'
ActiveEnergyBurned
'
,
FlightsClimbed
:
'
FlightsClimbed
'
,
DietaryEnergy
:
'
DietaryEnergy
'
,
}
};
};
...
@@ -44,6 +26,7 @@ const UNITS = {
...
@@ -44,6 +26,7 @@ const UNITS = {
gram
:
'
gram
'
,
gram
:
'
gram
'
,
pound
:
'
pound
'
,
pound
:
'
pound
'
,
meter
:
'
meter
'
,
meter
:
'
meter
'
,
mile
:
'
mile
'
,
inch
:
'
inch
'
,
inch
:
'
inch
'
,
foot
:
'
foot
'
,
foot
:
'
foot
'
,
second
:
'
second
'
,
second
:
'
second
'
,
...
...
examples/StepsDemo/app/components/home/index.js
View file @
a36f2331
...
@@ -16,18 +16,17 @@ import styles from '../../styles/styles';
...
@@ -16,18 +16,17 @@ import styles from '../../styles/styles';
import
History
from
'
./history
'
;
import
History
from
'
./history
'
;
// setup the HealthKit initialization options
// setup the HealthKit initialization options
const
WPERMS
=
AppleHealthKit
.
Constants
.
Permissions
.
WRITE
;
const
HKPERMS
=
AppleHealthKit
.
Constants
.
Permissions
;
const
RPERMS
=
AppleHealthKit
.
Constants
.
Permissions
.
READ
;
const
HKOPTIONS
=
{
const
HKOPTIONS
=
{
permissions
:
{
permissions
:
{
read
:
[
read
:
[
R
PERMS
.
StepCount
,
HK
PERMS
.
StepCount
,
R
PERMS
.
DistanceWalkingRunning
,
HK
PERMS
.
DistanceWalkingRunning
,
R
PERMS
.
FlightsClimbed
,
HK
PERMS
.
FlightsClimbed
,
R
PERMS
.
Height
,
HK
PERMS
.
Height
,
],
],
write
:
[
write
:
[
W
PERMS
.
StepCount
HK
PERMS
.
StepCount
],
],
}
}
};
};
...
@@ -59,23 +58,6 @@ class Home extends Component {
...
@@ -59,23 +58,6 @@ class Home extends Component {
}
}
this
.
_fetchStepsToday
();
this
.
_fetchStepsToday
();
this
.
_fetchStepsHistory
();
this
.
_fetchStepsHistory
();
//setTimeout(() => {
//
// let options = {
// value: 100,
// startDate: (new Date(2016,6,2,6,0,0)).toISOString(),
// endDate: (new Date(2016,6,2,6,30,0)).toISOString()
// };
// AppleHealthKit.saveSteps(options, (err, res) => {
// if(this._handleHKError(err, 'saveSteps')){
// return;
// }
// console.log('steps saved...');
// });
//
//},1000);
});
});
}
}
});
});
...
...
examples/StepsDemo/ios/StepsDemo.xcodeproj/project.pbxproj
View file @
a36f2331
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
140ED2AC1D01E1AD002B40FF
/* libReact.a in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
146834041AC3E56700842450
/* libReact.a */
;
};
140ED2AC1D01E1AD002B40FF
/* libReact.a in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
146834041AC3E56700842450
/* libReact.a */
;
};
146834051AC3E58100842450
/* libReact.a in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
146834041AC3E56700842450
/* libReact.a */
;
};
146834051AC3E58100842450
/* libReact.a in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
146834041AC3E56700842450
/* libReact.a */
;
};
378616B61D257B040027C300
/* HealthKit.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
378616B51D257B040027C300
/* HealthKit.framework */
;
};
378616B61D257B040027C300
/* HealthKit.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
378616B51D257B040027C300
/* HealthKit.framework */
;
};
378DCB4
61D3158A800E83D06
/* libRCTAppleHealthKit.a in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
378DCB451D315896
00E83D06
/* libRCTAppleHealthKit.a */
;
};
378DCB4
D1D3179B500E83D06
/* libRCTAppleHealthKit.a in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
378DCB4C1D3179B0
00E83D06
/* libRCTAppleHealthKit.a */
;
};
832341BD1AAA6AB300B99B32
/* libRCTText.a in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
832341B51AAA6A8300B99B32
/* libRCTText.a */
;
};
832341BD1AAA6AB300B99B32
/* libRCTText.a in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
832341B51AAA6A8300B99B32
/* libRCTText.a */
;
};
/* End PBXBuildFile section */
/* End PBXBuildFile section */
...
@@ -91,9 +91,9 @@
...
@@ -91,9 +91,9 @@
remoteGlobalIDString
=
83CBBA2E1A601D0E00E9B192
;
remoteGlobalIDString
=
83CBBA2E1A601D0E00E9B192
;
remoteInfo
=
React
;
remoteInfo
=
React
;
};
};
378DCB4
41D315896
00E83D06
/* PBXContainerItemProxy */
=
{
378DCB4
B1D3179B0
00E83D06
/* PBXContainerItemProxy */
=
{
isa
=
PBXContainerItemProxy
;
isa
=
PBXContainerItemProxy
;
containerPortal
=
378DCB4
01D315896
00E83D06
/* RCTAppleHealthKit.xcodeproj */
;
containerPortal
=
378DCB4
71D3179B0
00E83D06
/* RCTAppleHealthKit.xcodeproj */
;
proxyType
=
2
;
proxyType
=
2
;
remoteGlobalIDString
=
3774C88D1D2092F20000B3F3
;
remoteGlobalIDString
=
3774C88D1D2092F20000B3F3
;
remoteInfo
=
RCTAppleHealthKit
;
remoteInfo
=
RCTAppleHealthKit
;
...
@@ -136,7 +136,7 @@
...
@@ -136,7 +136,7 @@
146833FF1AC3E56700842450
/* React.xcodeproj */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
"wrapper.pb-project"
;
name
=
React.xcodeproj
;
path
=
"../node_modules/react-native/React/React.xcodeproj"
;
sourceTree
=
"<group>"
;
};
146833FF1AC3E56700842450
/* React.xcodeproj */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
"wrapper.pb-project"
;
name
=
React.xcodeproj
;
path
=
"../node_modules/react-native/React/React.xcodeproj"
;
sourceTree
=
"<group>"
;
};
378616B51D257B040027C300
/* HealthKit.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
HealthKit.framework
;
path
=
System/Library/Frameworks/HealthKit.framework
;
sourceTree
=
SDKROOT
;
};
378616B51D257B040027C300
/* HealthKit.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
HealthKit.framework
;
path
=
System/Library/Frameworks/HealthKit.framework
;
sourceTree
=
SDKROOT
;
};
378616B71D257B040027C300
/* StepsDemo.entitlements */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
text.xml
;
name
=
StepsDemo.entitlements
;
path
=
StepsDemo/StepsDemo.entitlements
;
sourceTree
=
"<group>"
;
};
378616B71D257B040027C300
/* StepsDemo.entitlements */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
text.xml
;
name
=
StepsDemo.entitlements
;
path
=
StepsDemo/StepsDemo.entitlements
;
sourceTree
=
"<group>"
;
};
378DCB4
01D315896
00E83D06
/* RCTAppleHealthKit.xcodeproj */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
"wrapper.pb-project"
;
name
=
RCTAppleHealthKit.xcodeproj
;
path
=
"../node_modules/react-native-apple-healthkit/RCTAppleHealthKit.xcodeproj"
;
sourceTree
=
"<group>"
;
};
378DCB4
71D3179B0
00E83D06
/* RCTAppleHealthKit.xcodeproj */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
"wrapper.pb-project"
;
name
=
RCTAppleHealthKit.xcodeproj
;
path
=
"../node_modules/react-native-apple-healthkit/RCTAppleHealthKit.xcodeproj"
;
sourceTree
=
"<group>"
;
};
78C398B01ACF4ADC00677621
/* RCTLinking.xcodeproj */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
"wrapper.pb-project"
;
name
=
RCTLinking.xcodeproj
;
path
=
"../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"
;
sourceTree
=
"<group>"
;
};
78C398B01ACF4ADC00677621
/* RCTLinking.xcodeproj */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
"wrapper.pb-project"
;
name
=
RCTLinking.xcodeproj
;
path
=
"../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"
;
sourceTree
=
"<group>"
;
};
832341B01AAA6A8300B99B32
/* RCTText.xcodeproj */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
"wrapper.pb-project"
;
name
=
RCTText.xcodeproj
;
path
=
"../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"
;
sourceTree
=
"<group>"
;
};
832341B01AAA6A8300B99B32
/* RCTText.xcodeproj */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
"wrapper.pb-project"
;
name
=
RCTText.xcodeproj
;
path
=
"../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"
;
sourceTree
=
"<group>"
;
};
/* End PBXFileReference section */
/* End PBXFileReference section */
...
@@ -154,7 +154,7 @@
...
@@ -154,7 +154,7 @@
isa
=
PBXFrameworksBuildPhase
;
isa
=
PBXFrameworksBuildPhase
;
buildActionMask
=
2147483647
;
buildActionMask
=
2147483647
;
files
=
(
files
=
(
378DCB4
61D3158A8
00E83D06
/* libRCTAppleHealthKit.a in Frameworks */
,
378DCB4
D1D3179B5
00E83D06
/* libRCTAppleHealthKit.a in Frameworks */
,
146834051AC3E58100842450
/* libReact.a in Frameworks */
,
146834051AC3E58100842450
/* libReact.a in Frameworks */
,
00C302E51ABCBA2D00DB3ED1
/* libRCTActionSheet.a in Frameworks */
,
00C302E51ABCBA2D00DB3ED1
/* libRCTActionSheet.a in Frameworks */
,
378616B61D257B040027C300
/* HealthKit.framework in Frameworks */
,
378616B61D257B040027C300
/* HealthKit.framework in Frameworks */
,
...
@@ -268,10 +268,10 @@
...
@@ -268,10 +268,10 @@
name
=
Products
;
name
=
Products
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
};
};
378DCB4
11D315896
00E83D06
/* Products */
=
{
378DCB4
81D3179B0
00E83D06
/* Products */
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
378DCB4
51D315896
00E83D06
/* libRCTAppleHealthKit.a */
,
378DCB4
C1D3179B0
00E83D06
/* libRCTAppleHealthKit.a */
,
);
);
name
=
Products
;
name
=
Products
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
...
@@ -287,7 +287,7 @@
...
@@ -287,7 +287,7 @@
832341AE1AAA6A7D00B99B32
/* Libraries */
=
{
832341AE1AAA6A7D00B99B32
/* Libraries */
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
378DCB4
01D315896
00E83D06
/* RCTAppleHealthKit.xcodeproj */
,
378DCB4
71D3179B0
00E83D06
/* RCTAppleHealthKit.xcodeproj */
,
146833FF1AC3E56700842450
/* React.xcodeproj */
,
146833FF1AC3E56700842450
/* React.xcodeproj */
,
00C302A71ABCB8CE00DB3ED1
/* RCTActionSheet.xcodeproj */
,
00C302A71ABCB8CE00DB3ED1
/* RCTActionSheet.xcodeproj */
,
00C302B51ABCB90400DB3ED1
/* RCTGeolocation.xcodeproj */
,
00C302B51ABCB90400DB3ED1
/* RCTGeolocation.xcodeproj */
,
...
@@ -411,8 +411,8 @@
...
@@ -411,8 +411,8 @@
ProjectRef
=
00C302A71ABCB8CE00DB3ED1
/* RCTActionSheet.xcodeproj */
;
ProjectRef
=
00C302A71ABCB8CE00DB3ED1
/* RCTActionSheet.xcodeproj */
;
},
},
{
{
ProductGroup
=
378DCB4
11D315896
00E83D06
/* Products */
;
ProductGroup
=
378DCB4
81D3179B0
00E83D06
/* Products */
;
ProjectRef
=
378DCB4
01D315896
00E83D06
/* RCTAppleHealthKit.xcodeproj */
;
ProjectRef
=
378DCB4
71D3179B0
00E83D06
/* RCTAppleHealthKit.xcodeproj */
;
},
},
{
{
ProductGroup
=
00C302B61ABCB90400DB3ED1
/* Products */
;
ProductGroup
=
00C302B61ABCB90400DB3ED1
/* Products */
;
...
@@ -516,11 +516,11 @@
...
@@ -516,11 +516,11 @@
remoteRef
=
146834031AC3E56700842450
/* PBXContainerItemProxy */
;
remoteRef
=
146834031AC3E56700842450
/* PBXContainerItemProxy */
;
sourceTree
=
BUILT_PRODUCTS_DIR
;
sourceTree
=
BUILT_PRODUCTS_DIR
;
};
};
378DCB4
51D315896
00E83D06
/* libRCTAppleHealthKit.a */
=
{
378DCB4
C1D3179B0
00E83D06
/* libRCTAppleHealthKit.a */
=
{
isa
=
PBXReferenceProxy
;
isa
=
PBXReferenceProxy
;
fileType
=
archive.ar
;
fileType
=
archive.ar
;
path
=
libRCTAppleHealthKit.a
;
path
=
libRCTAppleHealthKit.a
;
remoteRef
=
378DCB4
41D315896
00E83D06
/* PBXContainerItemProxy */
;
remoteRef
=
378DCB4
B1D3179B0
00E83D06
/* PBXContainerItemProxy */
;
sourceTree
=
BUILT_PRODUCTS_DIR
;
sourceTree
=
BUILT_PRODUCTS_DIR
;
};
};
78C398B91ACF4ADC00677621
/* libRCTLinking.a */
=
{
78C398B91ACF4ADC00677621
/* libRCTLinking.a */
=
{
...
...
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