saveTTSData(params: Object)

Requires:
OutdoorKit≥1.0.1@ray-js/ray≥1.4.40
Platforms:
iOSAndroid
import { outdoor } from '@ray-js/ray';

const { saveTTSData } = outdoor;

// Promise usage
try {
  const res = await saveTTSData({ ...params });
  console.log(res);
} catch (err) {
  console.log(err.errorMsg);
}

Description

Save cycling voice broadcast data

Parameters

PropertyTypeRequiredDescription
ttsMainSwitchbooleanYesGlobal switch for cycling data broadcast
weatherbooleanYesWeather
abnormalWearbooleanYesAbnormal wear voice alert switch
cyclingMileagebooleanYesCycling distance voice alert switch
lowBatterybooleanYesLow battery
electricThresholdnumberYesLow-battery voice alert threshold; triggers when the battery falls below this percentage
callReminderbooleanYesIncoming call voice alert switch
complete() => voidNoCompletion callback (executed on both success and failure)
NoCallback on successful API call
fail(params: Object) => voidNoFailure callback
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Examples

import { outdoor } from '@ray-js/ray'

outdoor.saveTTSData({
  ttsMainSwitch: false,
  weather: false,
  abnormalWear: false,
  cyclingMileage: false,
  lowBattery: false,
  electricThreshold: 1,
  callReminder: false,
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});