在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:react-native-device-info/react-native-device-info开源软件地址:https://github.com/react-native-device-info/react-native-device-info开源编程语言:TypeScript 32.9%开源软件介绍:react-native-device-infoDevice Information for React Native. TOC
v6 to v7 upgradeYour iOS Podfile will need to move to an iOS 10 minimum. v7 of this module no longer supports iOS9. InstallationUsing npm: npm install --save react-native-device-info or using yarn: yarn add react-native-device-info ProguardIf you want to use Install Referrer tracking, you will need to add this config to your Proguard config
If you are experiencing issues with hasGms() on your release apks, please add the following rule to your Proguard config
AndroidX SupportThis module defaults to AndroidX you should configure your library versions similar to this in your Android...
ext {
// dependency versions
We have 3 options for deviceId:
//Option 1 (latest):
firebaseIidVersion = "19.0.1" // default: "19.0.1"
//Option 2 (legacy GooglePlay dependency but using AndroidX):
googlePlayServicesIidVersion = "17.0.0" // default: "17.0.0" - AndroidX
//Option 3 (legacy GooglePlay dependency before AndroidX):
googlePlayServicesIidVersion = "16.0.1"
//include as needed:
compileSdkVersion = "28" // default: 28 (28 is required for AndroidX)
targetSdkVersion = "28" // default: 28 (28 is required for AndroidX)
supportLibVersion = '1.0.2' // Use '28.0.0' or don't specify for old libraries, '1.0.2' or similar for AndroidX
mediaCompatVersion = '1.0.1' // Do not specify if using old libraries, specify '1.0.1' or similar for androidx.media:media dependency
supportV4Version = '1.0.0' // Do not specify if using old libraries, specify '1.0.0' or similar for androidx.legacy:legacy-support-v4 dependency
}
... If you need non-AndroidX you will need to use the jetifier package in reverse mode, documentation available with that package. LinkingLinking in native modules is a frequent source of trouble for new react-native developers, resulting in errors like "RNDeviceInfo is null" etc. For this reason automatic linking was implemented, and it should be used in your project. Automatic linking is supported for all platforms (even windows on React native >= 0.63!) Previous versions need to do manual linking. No support is offered for these previous react-native versions but you may refer to older versions of this README if you like. Upgrade to modern versions of react-native. Use Usageimport DeviceInfo from 'react-native-device-info';
// or ES6+ destructured imports
import { getUniqueId, getManufacturer } from 'react-native-device-info'; APINote that many APIs are platform-specific. If there is no implementation for a platform, then the "default" return values you will receive are Most APIs return a Promise but also have a corresponding API with The example app in this repository shows an example usage of every single API, consult the example app if you have questions, and if you think you see a problem make sure you can reproduce it using the example app before reporting it, thank you.
|
请发表评论