Skip to content

Getting error when calling multipleQueryHKitSampleType #26

@Saqib92

Description

@Saqib92

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);
    }
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions