Skip to main content

mergHK

Type

library

Description

mergHK is an iOS HealthKit external for LiveCode. To use this external you must have use a provisioning profile with the HealthKit entitlement enabled. The Entitlements.xcent file in the iOS runtime directories inside the LiveCode app bundle need to me edited to include the com.apple.developer.healthkit entitlement.

Associated Syntax

Function

NameSummarySyntax
mergHKIsHealthDataAvailableCheck to see if HealthKit is availablemergHKIsHealthDataAvailable()
mergHKCheckAuthorizationChecks the current authorization status for a type identifiermergHKCheckAuthorization(<pIdentifier>)
mergHKBiologicalSexReads the user's biological sex settingmergHKBiologicalSex()
mergHKBloodTypeReads the user's blood type settingmergHKBloodType()
mergHKDateOfBirthReads the user's date of birth settingmergHKDateOfBirth()
mergHKFitzpatrickSkinTypeReads the user's skin type based on the Fitzpatrick scalemergHKFitzpatrickSkinType()

Command

NameSummarySyntax
mergHKRequestAuthorizationRequests permission to save and read the specified data typesmergHKRequestAuthorization <pShareIdentifiers>, <pReadIdentifiers>
mergHKSampleQueryQuery samples between given datesmergHKSampleQuery <pIdentifier>, <pStartDate>, <pEndDate>, [<pLimit>], [<pSortIdentifier>], [<pSortDirection>]
mergHKStopQueryStop a running querymergHKStopQuery <pQueryID>
mergHKAddQuantitySampleAdd a quantity samplemergHKAddQuantitySample <pIdentifier>, <pStartDate>, <pEndDate>, <pValue>, <pUnits>, [<pWorkoutUUID>], [<pMetadata>]
mergHKAddWorkoutAdd a workoutmergHKAddWorkout <pWorkoutType>, <pStartDate>, <pEndDate>, [<pTotalEnergyBurned>], [<pEnergyBurnedUnits>], [<pTotalDistance>], [<pDistanceUnits>], [<pMetadata>]

Message

NameSummarySyntax
mergHKAuthorizationCompleteSent to the object that called mergHKRequestAuthorization when the authorization is complete mergHKAuthorizationComplete <pError>
mergHKQueryResultsSent to the object that initiated a querymergHKQueryResults <pQueryID>, <pResultA>, <pError>
Thank you for your feedback!

Was this page helpful?