Your app has not yet asked the user for the authorization required to complete this task.
- iOS 8.0+
- Mac Catalyst 13.0+
- watchOS 2.0+
This error occurs when your app does not request proper authorization before calling any other HealthKit methods. For more information on setting up HealthKit, see HealthKit