Open IASudip opened 4 weeks ago
Updated Case: TTLock.getOperaitonLog command
with TTOperateRecordType.latest: It provide empty list
TTLock.getLockOperateRecord(TTOperateRecordType.latest, lockData, (operateRecord) { List<dynamic> fetchOperationList = jsonDecode(operateRecord); fetchOperationList.sort((a, b) => b["operateDate"] - a["operateDate"]); operationList.value = fetchOperationList; }, (errorCode, errorMsg) { if (errorCode == TTLockError.bluetoothConnectTimeount) { Utils.showToast("Record: time out"); } else { Utils.showToast("$errorCode"); } });
Hello Team, We are unable fetch latest recored for using both API and TTLock.getOperaitonLog command In case of API:
In case of TTLock.getOperaitonLog command
with TTOperateRecordType.latest: It provide empty list
TTLock.getLockOperateRecord(TTOperateRecordType.total, lockData, (operateRecord) { List<dynamic> fetchOperationList = jsonDecode(operateRecord); fetchOperationList.sort((a, b) => b["operateDate"] - a["operateDate"]); operationList.value = fetchOperationList; }, (errorCode, errorMsg) { if (errorCode == TTLockError.bluetoothConnectTimeount) { Utils.showToast("Record: time out"); } else { Utils.showToast("$errorCode"); } });
with TTOperateRecordType.total: It provide all records since first day it was initialised.
TTLock.getLockOperateRecord(TTOperateRecordType.total, lockData, (operateRecord) { List<dynamic> fetchOperationList = jsonDecode(operateRecord); fetchOperationList.sort((a, b) => b["operateDate"] - a["operateDate"]); operationList.value = fetchOperationList; }, (errorCode, errorMsg) { if (errorCode == TTLockError.bluetoothConnectTimeount) { Utils.showToast("Record: time out"); } else { Utils.showToast("$errorCode"); } });