updateCurrentIds method

Future<bool> updateCurrentIds()

Implementation

Future<bool> updateCurrentIds() async {
  log('Going to update the userId and the deviceId');
  try {
    currentUserId = await getUUID('currentUser');
    currentDeviceId = await getUUID('currentDevice');
    log('currentUserId: $currentUserId');
    log('currentDeviceId: $currentDeviceId');
    userSensorDataRootPath = ':Users:$currentUserId:$pluginId:data:metrics';
    deviceSensorDataRootPath =
        ':Devices:$currentDeviceId:$pluginId:data:metrics';
    recommendationRootPath =
        ':Devices:$currentDeviceId:$pluginId:data:recommendations';
    recommendationStatusRootPath =
        ':Devices:$currentDeviceId:$pluginId:data:recommendationStatus';
    log('userSensorDataRootPath: $userSensorDataRootPath');
    log('deviceSensorDataRootPath: $deviceSensorDataRootPath');
    log('recommendationRootPath: $recommendationRootPath');
    log('recommendationStatusRootPath: $recommendationStatusRootPath');
    return true;
  } catch (e, trace) {
    log('Failed to update the userId and the deviceId');
    log(e.toString());
    if (exceptionHandler != null) {
      exceptionHandler!(e, trace);
    }
    return false;
  }
}