1.0.0 • Published 7 months ago

@smart-link/rn-devices v1.0.0

Weekly downloads
-
License
-
Repository
-
Last release
7 months ago

@smart-link/rn-devices

安装

$ npm install @smart-link/rn-devices --save

引用

import RNDevices from '@smart-link/rn-devices';

文档

一、获取设备信息

响应:

{
  "code": "0000",
  "codeMsg": "获取设备信息成功",
  "data": {
    "appVersion": "1.0.0",
    "deviceBrand": "OPPO",
    "deviceLanguage": "zh",
    "deviceManufacturer": "OPPO",
    "deviceModel": "PBEM00",
    "deviceName": "PBEM00",
    "deviceVersion": "10"
  }
}

示例:

const res = await RNDevices.getDeviceInfo();

二、获取当前位置信息

响应:

{
  "code": "0000",
  "codeMsg": "获取位置信息成功",
  "data": {
    "latitude": 22.749012,
    "longitude": 108.376822,
    "countryName": "中国",
    "locality": "南宁市",
    "street": "广西壮族自治区南宁市良庆区良庆区中国东盟信息港小镇研发中心东50米(秋月 路)"
  }
}

示例:

const res = await RNDevices.getLocationInfo();
1.0.0

7 months ago