Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permissions and Workout data? #123

Open
tomfloate opened this issue Apr 27, 2021 · 2 comments
Open

Permissions and Workout data? #123

tomfloate opened this issue Apr 27, 2021 · 2 comments

Comments

@tomfloate
Copy link

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);
});

@shahraship
Copy link

Were you ever manage to resolve this? I'm facing the same error...

@sachinskumar41
Copy link

Does anyone get a solution for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants