Commit 5005b86a authored by Greg Wilson's avatar Greg Wilson Committed by GitHub

some fixes

parent 6e97ba39
...@@ -50,7 +50,7 @@ var AppleHealthKit = require('react-native-apple-healthkit'); ...@@ -50,7 +50,7 @@ var AppleHealthKit = require('react-native-apple-healthkit');
let healthKitOptions = { let healthKitOptions = {
permissions: { permissions: {
read: ["Height", "Weight", "Steps", "DateOfBirth", "BodyMassIndex"], read: ["Height", "Weight", "Steps", "DateOfBirth", "BodyMassIndex"],
write: ["Weight", "Steps"] write: ["Weight", "Steps", "BodyMassIndex"]
} }
}; };
...@@ -74,7 +74,7 @@ var _ = require('lodash'); ...@@ -74,7 +74,7 @@ var _ = require('lodash');
... ...
AppleHealthKit.getCurrentWeight(null, (err, weight) => { AppleHealthKit.getLatestWeight(null, (err, weight) => {
if(err){ if(err){
console.log("error getting current weight: ", err); console.log("error getting current weight: ", err);
return; return;
...@@ -86,7 +86,7 @@ AppleHealthKit.getCurrentWeight(null, (err, weight) => { ...@@ -86,7 +86,7 @@ AppleHealthKit.getCurrentWeight(null, (err, weight) => {
... ...
let myWeight = 200; let myWeight = 200;
AppleHealthKit.saveWeight({weight:myWeight}, (err, res) => { AppleHealthKit.saveWeight({value:myWeight}, (err, res) => {
if(err){ if(err){
console.log("error saving weight to healthkit: ", err); console.log("error saving weight to healthkit: ", err);
return; return;
...@@ -150,7 +150,7 @@ initialize HealthKit. this will show the HealthKit permissions prompt for any re ...@@ -150,7 +150,7 @@ initialize HealthKit. this will show the HealthKit permissions prompt for any re
let healthKitOptions = { let healthKitOptions = {
permissions: { permissions: {
read: ["Height", "Weight", "Steps", "DateOfBirth", "BodyMassIndex"], read: ["Height", "Weight", "Steps", "DateOfBirth", "BodyMassIndex"],
write: ["Weight"] write: ["Weight", "Steps", "BodyMassIndex"]
} }
}; };
``` ```
......
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