Skip to content

Conversation

@theolm
Copy link

@theolm theolm commented Jan 15, 2026

Context

Android’s Health Connect enforces a minimum scope policy, where apps must request only the permissions strictly required for their user-facing features.
Currently, reading workout sessions in this plugin implicitly requires Distance and Steps permissions, even when apps only need calories or basic exercise metadata.

This causes Play Store rejections for apps that do not expose distance or step data in their UI, as requesting these permissions cannot be justified under the policy.


What’s changed

  • Wrapped DistanceRecord reads in try/catch blocks
  • Wrapped StepsRecord reads in try/catch blocks
  • Allowed workout sessions to be processed even when optional metrics are unavailable
  • Ensured TotalCaloriesBurnedRecord continues to be read independently
  • Logged warnings instead of throwing errors when distance or steps data cannot be accessed

Notes

This approach ensures the plugin works correctly across all permission scenarios, whether apps request a minimal or extended Health Connect permission set.

The warning logs provide clear signals during debugging, indicating which optional permissions are required for missing workout properties, without breaking the overall data retrieval flow.

…energy burned, and steps data. Log warnings for any failures encountered during data retrieval.
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.

1 participant