Skip to content

0.4.0

Compare
Choose a tag to compare
@schaefba schaefba released this 21 Feb 00:32
· 5 commits to master since this release

This release adds support for the new types added in iOS 9.0, transitions several types to serialize using Open mHealth schemas, and fixes time serialization issues. This release contains breaking changes for some types, please see the Migrating section below.

  • Adds support for new types added in iOS 9.0 with generic Granola schemas:
    • Reproductive and sexual health
    • Dietary water
    • UV exposure
    • Apple stand hour
  • Transitions several types from generic Granola schemas to Open mHealth schemas:
    • Oxygen saturation
    • Respiratory rate
    • Basal energy burned
    • Body fat percentage
    • Body temperature
    • Basal body temperature
  • Adds additional tests for the serialization of new types and the serialization of timestamps.
  • Uses time zone information contained in the HKMetadataKeyTimeZone metadata field, when it is available, to serialize timestamps.
  • Fixes an issue where deserializing RFC3339 timestamps would create NSDate objects with incorrect nanoseconds.
  • Adds additional tests for date serialization and deserialization.
  • Adds more detailed documentation for the library.

Migrating

For the six types that transitioned from generic Granola schemas to OmH schemas, the format of the JSON data returned by the serializer will have different structure than previous versions of Granola. The new structure is consistent with the OmH schemas for those types, which you can view here.

If you want to retain serialization to the generic Granola schemas instead of the OmH schemas, you can make changes to the allSupportedQuantityTypeIdentifiersToClass method of the OMHHealthKitConstantsMapper.m class. In that method, you can change the mappers associated with the sample types of interest to the generic version.

For example, instead of having:

HKQuantityTypeIdentifierBodyTemperature: @"OMHSerializerBodyTemperature"

You can change it to the following to preserve serialization using the generic schemas:

HKQuantityTypeIdentifierBodyTemperature: @"OMHSerializerGenericQuantitySample"