diff --git a/ios/App/App/CoachHealthRoute.swift b/ios/App/App/CoachHealthRoute.swift index ee59697..ffa7967 100644 --- a/ios/App/App/CoachHealthRoute.swift +++ b/ios/App/App/CoachHealthRoute.swift @@ -11,6 +11,7 @@ // // r.available = bool (false si pas de route associƩe, pas d'autorisation, etc.) import Foundation +import UIKit import Capacitor import HealthKit import CoreLocation @@ -25,7 +26,12 @@ public class CoachHealthRoutePlugin: CAPPlugin, CAPBridgedPlugin { CAPPluginMethod(name: "getRoute", returnType: CAPPluginReturnPromise), ] - private let store = HKHealthStore() + private lazy var store = HKHealthStore() + + public override func load() { + NSLog("[CoachHealthRoute] plugin loaded (iOS \(UIDevice.current.systemVersion))") + super.load() + } @objc func isAvailable(_ call: CAPPluginCall) { call.resolve(["available": HKHealthStore.isHealthDataAvailable()])