Skip to content

API 全量清单 · 设备

设备

setClipboardData

设置剪贴板内容。

大概用法

三端策略

  • 微信:直连 `wx.setClipboardData`
  • 支付宝:转调 `my.setClipboard` 并映射 `data` → `text`
  • 抖音:直连 `tt.setClipboardData`

getClipboardData

获取剪贴板内容。

大概用法

三端策略

  • 微信:直连 `wx.getClipboardData`
  • 支付宝:转调 `my.getClipboard` 并映射 `text` → `data`
  • 抖音:直连 `tt.getClipboardData`

scanCode

⚠️

扫码。

大概用法

三端策略

  • 微信:直连 `wx.scanCode`
  • 支付宝:无同等 API,调用时按 unsupported 报错
  • 抖音:直连 `tt.scanCode`

getNetworkType

⚠️

获取网络类型。

大概用法

三端策略

  • 微信:直连 `wx.getNetworkType`
  • 支付宝:直连 `my.getNetworkType`
  • 抖音:无同等 API,调用时按 unsupported 报错

getBatteryInfo

⚠️

异步获取电量信息。

大概用法

三端策略

  • 微信:直连 `wx.getBatteryInfo`
  • 支付宝:直连 `my.getBatteryInfo`
  • 抖音:无同等 API,调用时按 unsupported 报错

getBatteryInfoSync

⚠️

同步获取电量信息。

大概用法

三端策略

  • 微信:直连 `wx.getBatteryInfoSync`
  • 支付宝:直连 `my.getBatteryInfoSync`
  • 抖音:无同等 API,调用时按 unsupported 报错

offMemoryWarning

⚠️

取消内存不足告警监听。

大概用法

三端策略

  • 微信:直连 `wx.offMemoryWarning`
  • 支付宝:直连 `my.offMemoryWarning`
  • 抖音:无同等 API,调用时按 unsupported 报错

onBLEConnectionStateChange

⚠️

监听 BLE 连接状态变化。

大概用法

三端策略

  • 微信:直连 `wx.onBLEConnectionStateChange`
  • 支付宝:映射到 `my.onBLEConnectionStateChanged`
  • 抖音:抖音无同等 API,调用时报 not supported

offBLEConnectionStateChange

⚠️

取消监听 BLE 连接状态变化。

大概用法

三端策略

  • 微信:直连 `wx.offBLEConnectionStateChange`
  • 支付宝:映射到 `my.offBLEConnectionStateChanged`
  • 抖音:抖音无同等 API,调用时报 not supported

addPhoneCalendar

⚠️

添加日历事件。

大概用法

三端策略

  • 微信:直连 `wx.addPhoneCalendar`
  • 支付宝:无同等 API,调用时按 unsupported 报错
  • 抖音:无同等 API,调用时按 unsupported 报错

addPhoneContact

⚠️

添加手机联系人。

大概用法

三端策略

  • 微信:直连 `wx.addPhoneContact`
  • 支付宝:直连 `my.addPhoneContact`
  • 抖音:无同等 API,调用时按 unsupported 报错

addPhoneRepeatCalendar

⚠️

添加重复日历事件。

大概用法

三端策略

  • 微信:直连 `wx.addPhoneRepeatCalendar`
  • 支付宝:无同等 API,调用时按 unsupported 报错
  • 抖音:无同等 API,调用时按 unsupported 报错

checkIsOpenAccessibility

⚠️

检测系统无障碍是否开启。

大概用法

三端策略

  • 微信:直连 `wx.checkIsOpenAccessibility`
  • 支付宝:无同等 API,调用时按 unsupported 报错
  • 抖音:无同等 API,调用时按 unsupported 报错

openSystemBluetoothSetting

⚠️

打开系统蓝牙设置页面。

大概用法

三端策略

  • 微信:直连 `wx.openSystemBluetoothSetting`
  • 支付宝:无同等 API,调用时按 unsupported 报错
  • 抖音:无同等 API,调用时按 unsupported 报错

closeBLEConnection

⚠️

断开低功耗蓝牙连接。

大概用法

三端策略

  • 微信:直连 `wx.closeBLEConnection`
  • 支付宝:`deviceId` 对齐后映射到 `my.disconnectBLEDevice`,并将 `errorCode/errorMessage` 映射为 `errCode/errMsg`
  • 抖音:无同等 API,调用时按 unsupported 报错

createBLEConnection

⚠️

创建低功耗蓝牙连接。

大概用法

三端策略

  • 微信:直连 `wx.createBLEConnection`
  • 支付宝:`deviceId/timeout` 对齐后映射到 `my.connectBLEDevice`,并将 `error/errorMessage` 映射为 `errCode/errMsg`
  • 抖音:无同等 API,调用时按 unsupported 报错

startDeviceMotionListening

⚠️

开始监听设备方向变化。

大概用法

三端策略

  • 微信:直连 `wx.startDeviceMotionListening`
  • 支付宝:无同等 API,调用时按 unsupported 报错
  • 抖音:无同等 API,调用时按 unsupported 报错

startHCE

⚠️

启动 HCE 功能。

大概用法

三端策略

  • 微信:直连 `wx.startHCE`
  • 支付宝:无同等 API,调用时按 unsupported 报错
  • 抖音:无同等 API,调用时按 unsupported 报错

stopDeviceMotionListening

⚠️

停止监听设备方向变化。

大概用法

三端策略

  • 微信:直连 `wx.stopDeviceMotionListening`
  • 支付宝:无同等 API,调用时按 unsupported 报错
  • 抖音:无同等 API,调用时按 unsupported 报错

sendSms

⚠️

发送短信。

大概用法

三端策略

  • 微信:直连 `wx.sendSms`
  • 支付宝:无同等 API,调用时按 unsupported 报错
  • 抖音:无同等 API,调用时按 unsupported 报错

stopHCE

⚠️

停止 HCE 功能。

大概用法

三端策略

  • 微信:直连 `wx.stopHCE`
  • 支付宝:无同等 API,调用时按 unsupported 报错
  • 抖音:无同等 API,调用时按 unsupported 报错

getHCEState

⚠️

获取 HCE 状态。

大概用法

三端策略

  • 微信:直连 `wx.getHCEState`
  • 支付宝:无同等 API,调用时按 unsupported 报错
  • 抖音:无同等 API,调用时按 unsupported 报错

getNFCAdapter

⚠️

获取 NFC 适配器。

大概用法

三端策略

  • 微信:直连 `wx.getNFCAdapter`
  • 支付宝:无同等 API,调用时按 unsupported 报错
  • 抖音:无同等 API,调用时按 unsupported 报错

getRandomValues

⚠️

获取随机值。

大概用法

三端策略

  • 微信:直连 `wx.getRandomValues`
  • 支付宝:无同等 API,调用时按 unsupported 报错
  • 抖音:无同等 API,调用时按 unsupported 报错

getScreenRecordingState

⚠️

获取录屏状态。

大概用法

三端策略

  • 微信:直连 `wx.getScreenRecordingState`
  • 支付宝:无同等 API,调用时按 unsupported 报错
  • 抖音:无同等 API,调用时按 unsupported 报错

isBluetoothDevicePaired

⚠️

判断蓝牙设备是否已配对。

大概用法

三端策略

  • 微信:直连 `wx.isBluetoothDevicePaired`
  • 支付宝:无同等 API,调用时按 unsupported 报错
  • 抖音:无同等 API,调用时按 unsupported 报错

createBLEPeripheralServer

⚠️

创建 BLE 外设服务实例。

大概用法

三端策略

  • 微信:直连 `wx.createBLEPeripheralServer`
  • 支付宝:无同等 API,调用时按 unsupported 报错
  • 抖音:无同等 API,调用时按 unsupported 报错

Released under the MIT License.