JSI Turbo module support for react-native-device-info
.
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
- 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
-
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.
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();
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.
MIT
Made with create-react-native-library