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

feat: add scripts to generate sample types and workout names #144

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

grounded042
Copy link
Contributor

As iOS versions release there are new workouts and sample types available in HealthKit. This PR adds two scripts to automatically generate code for sample types and workouts.

By generating sample types we will support all sample types instead of sample types manually added. While doing this I discovered some sample types which Apple does not allow you to import so those are excluded.

By generating workout types all the newest workout types are supported. I also discovered that workouts with compound names were not correctly supported in the current version of the project. Example: importing a Cross Training workout didn't work correctly as it's called CrossTraining in the xml. This is fixed using the generated code and I added a test case as well.

I discovered that if you import a HKCategoryTypeIdentifierAudioExposureEvent with the value of 0 HealthKit will error out. I added code so as to avoid that.

@grounded042 grounded042 mentioned this pull request Jan 1, 2025
@Acgua
Copy link

Acgua commented Jan 2, 2025

This is a great major improvement, thank you! However, I haven't tested the .sh scripts (yet).

@smash-96
Copy link

smash-96 commented Feb 3, 2025

I just used the fix in the PR. If this fix wasn't here then I would have wasted a lot of days.
Thank you so much @grounded042 .

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

Successfully merging this pull request may close these issues.

3 participants