TypeMismatchError:错误的人类活动记录器类型通过
这是我的代码:
if (tizen.systeminfo.getCapability('http://tizen.org/feature/sensor.pedometer') === false) {
console.log('pedometer is not supported on this device.');
}
else {
var query = {};
query.startTime =(new Date(2022, 10, 5)).getTime() / 1000;
query.endTime = (new Date(2022, 7, 31)).getTime() / 1000;
query.anchorTime = (new Date(2022, 7, 31, 0, 0)).getTime() / 1000;
query.interval = 1440; /* Day */
console.log(JSON.stringify(query));
tizen.humanactivitymonitor.readRecorderData('PEDOMETER', query, successCallback, errorCallback);
}我总是获得以下错误消息:
TypeMismatchError:传递错误的人类活动记录器类型
我在config.xml声明:
<feature name="http://tizen.org/feature/screen.size.normal"/>
<feature name="tizen.org/feature/sensor.pedometer"/>
<tizen:privilege name="http://tizen.org/privilege/location"/>
<tizen:privilege name="http://tizen.org/privilege/healthinfo"/>
<tizen:privilege name="http://tizen.org/privilege/application.launch"/>发布于 2022-10-11 06:26:50
查询中的endTime不能在startTime之前。当我在您的代码中只更改endTime时,它不会得到TypeMismatchError。
您可以知道链接下面的错误类型。
https://docs.tizen.org/application/web/api/6.5/device_api/wearable/tizen/humanactivitymonitor.html
WebAPIException
with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
with error type UnknownError, if registering the success callback fails because of an unknown error.
with error type NotSupportedError, if the given type is not supported on a device or by this method.
with error type SecurityError, if the application does not have the privilege to use this function.https://stackoverflow.com/questions/73968906
复制相似问题