Socket
Book a DemoInstallSign in
Socket

@smart-link/rn-devices

Package Overview
Dependencies
Maintainers
3
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@smart-link/rn-devices

## 安装

latest
npmnpm
Version
1.0.0
Version published
Maintainers
3
Created
Source

@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();

Keywords

react-native

FAQs

Package last updated on 08 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts