首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏React Native开发圈

    React Native获取设备信息组件

    这次介绍的获取移动设备信息的组件名叫:react-native-device-info,兼容IOS和安卓双平台,可以获取设备ID、设备品牌、设备型号、IP以及APP版本号等信息。 安装 npm install--save react-native-device-info 注:如果React Naitve的版本大于0.47,那么需要使用>=0.11版本的react-native-device-info 组件 因为涉及到原生代码,所以在执行完install后,需要执行link命令 react-nativelink react-native-device-info 使用示例 import DeviceInfo from 'react-native-device-info'; const device = {}; device.DeviceID = deviceInfo.getUniqueID(); GitHub地址:https://github.com/rebeccahughes/react-native-device-info

    3.2K10发布于 2018-08-03
  • 来自专栏IT架构圈

    react-native获取设备信息组件(react-native-device-info

    二、组件介绍 1.首先需要安装组件:npm install react-native-device-info --save 2.IOS初始化:打开Xcode——>右击Libraries——>选择文件到当前项目 ,进入到node_modules/react-native-device-info——>添加.xcodeproj文件 2.1.在Xcode中点击你的工程名字——>Build Phases——>Link /React 并且修改 recursive 2.3.好了,下面就是基本的用法了 import DeviceInfo from 'react-native-device-info' console.log DeviceInfo.getDeviceCountry()); // e.g US 3.Android的安装: 3.1首先需要修改下Gradle文件 在你的根目录下运行:react-native link react-native-device-info 翻译链接:https://github.com/rebeccahughes/react-native-device-info

    2.7K30发布于 2018-06-01
  • 来自专栏王磊的博客

    ReactNative常用组件汇总

    ://github.com/react-community/react-navigation 网络请求 asios: https://github.com/mzabriskie/axios 设备信息 react-native-device-info : https://github.com/rebeccahughes/react-native-device-info 缓存使用 react-native-storage: https://github.com

    1.1K50发布于 2018-05-08
  • 来自专栏RN 技术

    五分钟实现,一个RN App开发调试工具

    setTimeout(() => Alert.alert('环境切换', '服务器环境已经切换至' + baseUrl), 1000) }); 注:当前设备信息的显示依赖于 'react-native-device-info ' 库 需在调用页面引入依赖:import DeviceInfo from 'react-native-device-info';并把DeviceInfo传入到DebugManager的初始化参数中。

    1.3K40发布于 2020-04-20
  • 来自专栏phodal

    Dore 混合应用框架 —— 基于 React Native 的混合应用迁移方案

    当前支持以下的插件: BackHandler (Android) Brightness (by react-native-device-brightness) Console DeviceInfo (by react-native-device-info

    2K50发布于 2018-01-24
  • 来自专栏phodal

    React Native 持续部署实践— push 代码构建出新版的 Growth

    toBeCalledWith('https://www.phodal.com/'); }); 唯一比较麻烦的是,当我们要测试原生的组件,需要在 jest.setup.js 中 mock 这些方法,如下是用来 mock 包 react-native-device-info 中的 getVersion 方法: jest.mock('react-native-device-info', () => ({ getVersion: jest.fn(),})); 而 React

    2.7K50发布于 2018-01-29
  • 来自专栏Newxc03的前端之路

    React Native实现自定义顶部导航栏

    ViewPropTypes, } from 'react-native'; import PropTypes from 'prop-types'; import DeviceInfo from 'react-native-device-info

    2.3K40编辑于 2022-05-05
  • 来自专栏向治洪

    React Native之常用第三方库

    react-native-animatable 动画 react-native-carousel 轮播 react-native-countdown 倒计时 react-native-device-info PDF https://github.com/cnjon/react-native-pdf-view 获取设备信息 https://github.com/rebeccahughes/react-native-device-info

    10.3K101发布于 2018-02-05
  • 来自专栏IT架构圈

    RN组件库-别考虑了关注收藏吧

    和ios的toast https://github.com/remobile/react-native-toast 获取设备各类信息 https://github.com/rebeccahughes/react-native-device-info

    2.5K40发布于 2018-05-31
领券