getMobileDeviceInfo
获取设备基础信息
引入
import { getMobileDeviceInfo } from '@ray-js/ray';
需引入
BaseKit,且在>=2.4.3版本才可使用
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 |
object.success 回调参数
参数
Object res
| 属性 | 类型 | 说明 |
|---|---|---|
| abi | string | 应用二进制接口类型(仅 Android 支持) |
| brand | string | 设备品牌 |
| model | string | 设备型号。新机型刚推出一段时间会显示 unknown。 |
| system | string | 操作系统及版本 |
| platform | string | 客户端平台 |
object.fail 回调参数
参数
Object res
| 属性 | 类型 | 说明 |
|---|---|---|
| errorMsg | string | 插件错误信息 |
| errorCode | string | 错误码 |
| innerError | object | 插件外部依赖错误信息 {errorMsg: string, errorCode: string } |
openSystemBluetoothSetting
跳转系统蓝牙设置页 (仅 Android)
引入
import { openSystemBluetoothSetting } from '@ray-js/ray';
需引入
BaseKit,且在>=2.4.3版本才可使用
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 |
👉 立即免费领取开发资源,体验涂鸦 MiniApp 小程序开发。
updateVolume
设置系统音量
错误码标注 入参值范围超出 errorCode = 6, The volume value is invalid, it should be [0 - 1]
引入
import { updateVolume } from '@ray-js/ray';
需引入
BaseKit,且在>=2.4.3版本才可使用
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| value | number | 是 | 音量,阈值【0 - 1】 | |
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 |
registerSystemVolumeChange
注册系统音量监听
关联 API:[onSystemVolumeChangeEvent, unRegisterSystemVolumeChange]
引入
import { registerSystemVolumeChange } from '@ray-js/ray';
需引入
BaseKit,且在>=2.5.0版本才可使用
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 |
unRegisterSystemVolumeChange
取消注册系统音量监听
关联 API:[onSystemVolumeChangeEvent, registerSystemVolumeChange]
引入
import { unRegisterSystemVolumeChange } from '@ray-js/ray';
需引入
BaseKit,且在>=2.5.0版本才可使用
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 |
onSystemVolumeChangeEvent
系统音量监听通知事件
关联 API:[registerSystemVolumeChange, unRegisterSystemVolumeChange]
引入
import { onSystemVolumeChangeEvent } from '@ray-js/ray';
需引入
BaseKit,且在>=2.5.0版本才可使用
参数
function callback
系统音量监听通知事件
关联 API:[registerSystemVolumeChange, unRegisterSystemVolumeChange]的回调函数
回调参数 Object res
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| value | number | 是 | 音量,阈值【0 - 1】 |
offSystemVolumeChangeEvent
取消监听:系统音量监听通知事件
关联 API:[registerSystemVolumeChange, unRegisterSystemVolumeChange]
引入
import { offSystemVolumeChangeEvent } from '@ray-js/ray';
需引入
BaseKit,且在>=2.5.0版本才可使用
参数
function callback
取消监听:系统音量监听通知事件
关联 API:[registerSystemVolumeChange, unRegisterSystemVolumeChange]的回调函数
回调参数 Object res
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| value | number | 是 | 音量,阈值【0 - 1】 |
👉 立即免费领取开发资源,体验涂鸦 MiniApp 小程序开发。
&spm=1001.2101.3001.5002&articleId=138540937&d=1&t=3&u=6133f2a5a15f47b8ac1cd4890246e0b3)
711

被折叠的 条评论
为什么被折叠?



