Skip to content

Commit

Permalink
#73 Add iOS 10 usage description
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyVerbruggen committed Aug 12, 2016
1 parent d8a461a commit 11d659d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
14 changes: 11 additions & 3 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,19 @@ <h1>Apache Cordova</h1>
}

function requestAuthorization() {
var supportedTypes = [
'HKQuantityTypeIdentifierHeight',
'HKQuantityTypeIdentifierStepCount',
'HKQuantityTypeIdentifierDistanceWalkingRunning',
'HKCategoryTypeIdentifierSleepAnalysis',
'HKQuantityTypeIdentifierDietaryEnergyConsumed',
'HKQuantityTypeIdentifierDietaryFatTotal'
];

window.plugins.healthkit.requestAuthorization(
{
readTypes: ['HKCharacteristicTypeIdentifierDateOfBirth',
'HKCategoryTypeIdentifierSleepAnalysis', 'HKQuantityTypeIdentifierActiveEnergyBurned', 'HKQuantityTypeIdentifierHeight'],
writeTypes: ['HKQuantityTypeIdentifierDietaryEnergyConsumed', 'HKQuantityTypeIdentifierDietaryFatTotal', 'HKQuantityTypeIdentifierStepCount', 'HKQuantityTypeIdentifierActiveEnergyBurned', 'HKQuantityTypeIdentifierHeight', 'HKQuantityTypeIdentifierDistanceCycling']
readTypes: supportedTypes,
writeTypes: supportedTypes
},
callback,
callback
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.5.0",
"version": "0.5.1",
"name": "com.telerik.plugins.healthkit",
"cordova_name": "HealthKit",
"description": "Interact with the iOS HealthKit SDK.",
Expand Down
10 changes: 9 additions & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
id="com.telerik.plugins.healthkit"
version="0.5.0">
version="0.5.1">

<name>HealthKit</name>

Expand Down Expand Up @@ -43,6 +43,14 @@
</array>
</config-file-->

<!-- Usage description of Health, mandatory since iOS 10 -->
<config-file target="*-Info.plist" parent="NSHealthShareUsageDescription">
<string/>
</config-file>
<config-file target="*-Info.plist" parent="NSHealthUpdateUsageDescription">
<string/>
</config-file>

<header-file src="src/ios/WorkoutActivityConversion.h"/>
<source-file src="src/ios/WorkoutActivityConversion.m"/>
<header-file src="src/ios/HKHealthStore+AAPLExtensions.h"/>
Expand Down

0 comments on commit 11d659d

Please sign in to comment.