@@ -46,6 +46,8 @@ <h1>Apache Cordova</h1>
4646 < button onclick ="readGender() "> Read gender</ button >
4747 < br /> < br />
4848 < button onclick ="readBloodType() "> Read bloodtype</ button >
49+
50+ < button onclick ="readFitzpatrickSkinType() "> Fitzp. Skin type</ button >
4951 < br /> < br />
5052 < button onclick ="querySampleType() "> Query Sample</ button >
5153 < br /> < br />
@@ -113,9 +115,9 @@ <h1>Apache Cordova</h1>
113115 function requestAuthorization ( ) {
114116 window . plugins . healthkit . requestAuthorization (
115117 {
116- ' readTypes' : [ 'HKCharacteristicTypeIdentifierDateOfBirth' ,
118+ readTypes : [ 'HKCharacteristicTypeIdentifierDateOfBirth' ,
117119 'HKCategoryTypeIdentifierSleepAnalysis' , 'HKQuantityTypeIdentifierActiveEnergyBurned' , 'HKQuantityTypeIdentifierHeight' ] ,
118- ' writeTypes' : [ 'HKQuantityTypeIdentifierDietaryEnergyConsumed' , 'HKQuantityTypeIdentifierDietaryFatTotal' , 'HKQuantityTypeIdentifierStepCount' , 'HKQuantityTypeIdentifierActiveEnergyBurned' , 'HKQuantityTypeIdentifierHeight' , 'HKQuantityTypeIdentifierDistanceCycling' ]
120+ writeTypes : [ 'HKQuantityTypeIdentifierDietaryEnergyConsumed' , 'HKQuantityTypeIdentifierDietaryFatTotal' , 'HKQuantityTypeIdentifierStepCount' , 'HKQuantityTypeIdentifierActiveEnergyBurned' , 'HKQuantityTypeIdentifierHeight' , 'HKQuantityTypeIdentifierDistanceCycling' ]
119121 } ,
120122 callback ,
121123 callback
@@ -153,6 +155,13 @@ <h1>Apache Cordova</h1>
153155 ) ;
154156 }
155157
158+ function readFitzpatrickSkinType ( ) {
159+ window . plugins . healthkit . readFitzpatrickSkinType (
160+ callback ,
161+ callback
162+ ) ;
163+ }
164+
156165 function saveWeight ( ) {
157166 window . plugins . healthkit . saveWeight ( {
158167 'requestReadPermission' : false , // use if your app doesn't need to read
@@ -228,8 +237,9 @@ <h1>Apache Cordova</h1>
228237 {
229238 'startDate' : new Date ( new Date ( ) . getTime ( ) - 3 * 24 * 60 * 60 * 1000 ) , // three days ago
230239 'endDate' : new Date ( ) , // now
231- 'sampleType' : 'HKQuantityTypeIdentifierStepCount' , // anything in HealthKit/HKTypeIdentifiers.h
232- 'unit' : 'count' // make sure this is compatible with the sampleType
240+ 'sampleType' : 'HKQuantityTypeIdentifierBasalBodyTemperature' ,
241+ //'sampleType': 'HKQuantityTypeIdentifierStepCount', // anything in HealthKit/HKTypeIdentifiers.h
242+ 'unit' : 'degF' // make sure this is compatible with the sampleType
233243 } ,
234244 callback ,
235245 callback
0 commit comments