saveTTSData(params: Object)

版本要求:
OutdoorKit≥1.0.1@ray-js/ray≥1.4.40
支持平台:
iOSAndroid
import { outdoor } from '@ray-js/ray';

const { saveTTSData } = outdoor;

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

描述

保存骑行语音播报数据

参数

属性类型必填说明
ttsMainSwitchboolean是骑行数据播报总开关
weatherboolean是天气
abnormalWearboolean是异常佩戴播报开关
cyclingMileageboolean是骑行里程播报开关
lowBatteryboolean是低电量
electricThresholdnumber是低电量播报阈值,电量低于该百分比时触发播报
callReminderboolean是来电提醒播报开关
complete() => void否接口调用结束的回调函数(调用成功、失败都会执行)
否接口调用成功的回调函数
fail(params: Object) => void否接口调用失败的回调函数
fail 回调参数
属性类型说明
errorMsgstring错误信息
errorCodestring | number错误码
错误扩展

返回值

无

示例代码

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);
  },
});