OvalMoney / react-native-fitness

A React Native module to interact with Apple Healthkit and Google Fit.
MIT License
344 stars 68 forks source link

Unable to Fetch Steps with Minute Interval in Android #117

Open anirudhkudikala1 opened 5 months ago

anirudhkudikala1 commented 5 months ago

When attempting to fetch steps with a minute interval using the getSteps function in Android, the code execution stops at the getSteps method without any error being logged. I am using @ovalmoney/react-native-fitness v0.5.3

export async function getSteps(fromDate, toDate) {
    const options = {
        startDate: fromDate, // required ISO8601Timestamp
        endDate: toDate, // required ISO8601Timestamp
        interval: "minute"
    };
    try {
        const data = await Fitness.getSteps(options);
        console.log("data", data);
        return data;
    } catch (error) {
        console.error("Error fetching steps:", error);
    }
}

Expected Behaviour: The getSteps function should successfully fetch steps with a minute interval and log the data to the console.

Actual Behavior: Code execution stops at the getSteps method without any error being logged.

Steps to Reproduce:

  1. Use the provided getSteps function with a minute interval in an Android environment.
  2. Attempt to fetch steps within a specific time range.
  3. Observe that code execution stops at the getSteps method without any error being logged.

Additional Information: This issue occurs specifically when attempting to fetch steps with a minute interval. No error messages are logged, making it challenging to debug the issue. Steps are fetched with the days interval without any problem in both android and iOS. Please respond as soon as possible as we are in active development phase and the app release date is near. We have a requirement to fetch the data from last 10 days. But as a work around, I reduced the time and fetched the steps with minute interval of last one hour. It is working. Let me know if there is a data ceiling for steps with minute interval.

Environment: Platform: Android RN version: 0.71.3