getMobileDeviceInfo(params: Object)

版本要求:
BaseKit≥2.4.3@ray-js/ray≥1.6.8
支持平台:
iOSAndroid
import { getMobileDeviceInfo } from '@ray-js/ray';

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

描述

获取设备基础信息

参数

属性类型必填说明
complete() => void否接口调用结束的回调函数(调用成功、失败都会执行)
success(params: Object) => void否接口调用成功的回调函数
fail(params: Object) => void否接口调用失败的回调函数
success 回调参数
属性类型说明BaseKit 最低版本
abistring应用二进制接口类型(仅 Android 支持)v3.2.6
brandstring设备品牌v3.2.6
modelstring设备型号。新机型刚推出一段时间会显示unknown。v3.2.6
systemstring操作系统及版本v3.2.6
platformstring系统类型,如 ios、android、harmonyv3.2.6
uuidstring设备唯一标识v3.35.5
fail 回调参数
属性类型说明
errorMsgstring错误信息
errorCodestring | number错误码
错误扩展

返回值

无

示例代码

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

getMobileDeviceInfo({
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});