Skip to content

How to Use HKWorkoutSession and Start an Activity in React Native? #107

@heritvithalani19

Description

@heritvithalani19

Hello,

I am trying to use HKWorkoutSession to start an activity from my React Native app using this library. However, I am unclear on how to correctly initiate a workout session and manage its lifecycle (start, pause, and end). Apple documentation

Specifically, I would appreciate guidance on the following:

How to correctly instantiate an HKWorkoutSession in React Native using this library.
What parameters and configurations are required to start a workout session (e.g., workout type, activity options).
Best practices for monitoring workout session status (active, paused, ended) and handling session completion.
How to capture workout metrics like heart rate, calories, and distance during the session.
Here is a brief overview of my current setup:

React Native version: 0.71.19
HealthKit permissions are already granted.
Thank you for your assistance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions