0.3.0 • Published 2 years ago
react-native-turbo-device-info v0.3.0
react-native-turbo-device-info
JSI Turbo module support for react-native-device-info
.
Installation
NOTE: Before you get started, this library will work only on react-native new architecture. Make sure you are using
react-native 0.68
version at least. This is a pre-release version your project might be crashed in production.
npm install react-native-turbo-device-info
ios
- In your podfile make sure you have enabled hermes and fabric flag.
flags[:hermes_enabled] = true
flags[:fabric_enabled] = true
- Pod install with
RCT_NEW_ARCH_ENABLED
flag
RCT_NEW_ARCH_ENABLED=1 bundle exec pod install
Android
In android make sure you have hermes enabled. Follow this step to enable hermes.
Enable new Architecture in
gradle.properites
file
newArchEnabled=true
- clean and rebuild your project.
Usage
Curretly This library has only 2 working methods as an experiment.
import { getIpAddress, getMacAddress } from "react-native-turbo-device-info";
// Don't need to use Promise based function since we are using JSI turbo modules this call can be syncronised.
const ipAddress = getIpAddress();
const getMacAddress = getMacAddress();
Contributing
You can make PR if you can migrate any native module methods which is not in exisitng in this library.
If you are facing any problems while installing this library, feel free to create an issue.
License
MIT
Made with create-react-native-library