forked from incentfit/HealthKit
-
Notifications
You must be signed in to change notification settings - Fork 140
Open
Description
On android 15 latest version return empty array.
this is my code:
import { Injectable } from '@angular/core';
declare var cordova: any;
@Injectable({
providedIn: 'root'
})
export class HealthService {
constructor() { }
getData(startDate: any, endDate: any, type: string): Promise<any> {
return new Promise((resolve, reject) => {
try {
let datatypes = {
read: ['steps', 'calories', 'distance']
};
cordova.plugins.health.requestAuthorization(datatypes, (succ: any) => {
if (succ) {
let opt = {
startDate: new Date(startDate),
endDate: new Date(),
dataType: type.toLowerCase(),
limit: 5000
};
cordova.plugins.health.query(opt, (data: any) => {
console.log(data) // empty array []
resolve(data);
}, (err: any) => {
console.log(err)
reject(err);
});
}
}, (err2: any) => {
reject(err2);
});
} catch (e: any) {
console.log(e)
}
});
}
}
Surprisingly, old version v2.1.0 is working fine on android 15 but showing app blocked popup on android < 15.
In new version:
queryAggregated()
is returning data only for calories no data for steps and distance.
Metadata
Metadata
Assignees
Labels
No labels