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
026fec5b
Commit
026fec5b
authored
Sep 01, 2017
by
Terrillo Walls
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
getLatestWeight updated
parent
671b3bf6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
17 deletions
+22
-17
README.md
README.md
+22
-17
No files found.
README.md
View file @
026fec5b
...
@@ -94,26 +94,31 @@ When the module has been successfully initialized you can read and write HealthK
...
@@ -94,26 +94,31 @@ When the module has been successfully initialized you can read and write HealthK
var
AppleHealthKit
=
require
(
'
rn-apple-healthkit
'
);
var
AppleHealthKit
=
require
(
'
rn-apple-healthkit
'
);
var
_
=
require
(
'
lodash
'
);
var
_
=
require
(
'
lodash
'
);
...
AppleHealthKit
.
getLatestWeight
(
null
,
(
err
:
Object
,
weight
:
Object
)
=>
{
AppleHealthKit
.
initHealthKit
(
null
:
Object
,
(
err
:
string
,
res
:
Object
)
=>
{
...
AppleHealthKit
.
getLatestWeight
(
null
,
(
err
:
Object
,
weight
:
Object
)
=>
{
if
(
err
){
if
(
err
){
console
.
log
(
"
error getting current weight:
"
,
err
);
console
.
log
(
"
error getting current weight:
"
,
err
);
return
;
return
;
}
}
// use weight.value ...
// use weight.value ...
});
});
...
...
let
options
=
{
value
:
200
};
let
options
=
{
value
:
200
};
AppleHealthKit
.
saveWeight
(
options
:
Object
,
(
err
:
Object
,
res
:
Object
)
=>
{
AppleHealthKit
.
saveWeight
(
options
:
Object
,
(
err
:
Object
,
res
:
Object
)
=>
{
if
(
err
){
if
(
err
){
console
.
log
(
"
error saving weight to healthkit:
"
,
err
);
console
.
log
(
"
error saving weight to healthkit:
"
,
err
);
return
;
return
;
}
}
// weight successfully saved
// weight successfully saved
});
});
}
```
```
...
...
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