We are having issues with the permissions on this to get both step data AND workout data at the same time. Also the plugin for getting workout data takes no parameters and returns every workout ever? Is there no alternative/a better way to do this?
The functions we are using...
Workouts - findWorkouts()
The call we want to use to get Workout permission as well is called requestAuthorization(). It feels like we cant find the correct identifier to get workouts here as well as step data.
Our current requestAuthorization call is as below:
The below call also always hits the error, never the success if they have allowed or denied access:
this.healthKit.findWorkouts().then(success1 => {
// for some reason never hits here
console.log('workouts1', success1);
}, success2 => {
console.log('workouts2', success2);
});
We are having issues with the permissions on this to get both step data AND workout data at the same time. Also the plugin for getting workout data takes no parameters and returns every workout ever? Is there no alternative/a better way to do this?
The functions we are using...
Workouts - findWorkouts()
The call we want to use to get Workout permission as well is called requestAuthorization(). It feels like we cant find the correct identifier to get workouts here as well as step data.
Our current requestAuthorization call is as below:
requestOptions: HealthKitOptions = { readTypes: ['HKQuantityTypeIdentifierStepCount'], writeTypes: ['HKQuantityTypeIdentifierStepCount'] }; this.healthKit.requestAuthorization(this.requestOptions).then(success => { console.log('auth success', success); this.checkAppleHealthPermissions(); }, error => { console.log('auth error', error); });
The below call also always hits the error, never the success if they have allowed or denied access:
this.healthKit.findWorkouts().then(success1 => { // for some reason never hits here console.log('workouts1', success1); }, success2 => { console.log('workouts2', success2); });