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

Getting error when calling multipleQueryHKitSampleType #26

Open
Saqib92 opened this issue Aug 2, 2023 · 1 comment
Open

Getting error when calling multipleQueryHKitSampleType #26

Saqib92 opened this issue Aug 2, 2023 · 1 comment

Comments

@Saqib92
Copy link

Saqib92 commented Aug 2, 2023

querying multiple options.

Error: [Error] Error: Must provide startDate
CapacitorException — index.js:85
returnResult — user-script:2:768
(anonymous function) — user-script:2:750
if (Capacitor.getPlatform() == 'ios') {
      this.getIosData(new Date('07/10/2023').toISOString(), new Date('07/15/2023').toISOString());
}


async getIosData(startDate: string, endDate: string) {
    
    try {
      const queryOptions: MultipleQueryOptions = {
        sampleNames: [SampleNames.STEP_COUNT, SampleNames.WEIGHT],
        startDate: startDate,
        endDate: endDate,
        limit: 0,
      };

      console.log(queryOptions)

      let res = await CapacitorHealthkit.multipleQueryHKitSampleType(queryOptions);
      console.log(res);

    } catch (error) {
      console.error(error);
    }
  }
@dheerajkumarsqm
Copy link

Facing same issue.

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

No branches or pull requests

2 participants