Skip to content

khantsithu1998/react-native-jsi-device-info

Repository files navigation

react-native-jsi-device-info

npm version npm total downloads npm monthly downloads npm weekly downloads

Device Information Through JSI for React Native.

Installation

Vanilla React Native

yarn

yarn add react-native-jsi-device-info

or

npm

npm install react-native-jsi-device-info

And

cd ios && pod install

Expo

expo install react-native-jsi-device-info
expo prebuild

Basic usage example

import JSIDeviceInfo from "react-native-jsi-device-info";

JSIDeviceInfo.getDeviceName() // returns Device Name 
// Example
// iOS: "Khant Si Thu's iPhone 7"
// Android: ?
// Windows: ?

Run the example app for more.

API

Note that many APIs are platform-specific. If there is no implementation for a platform, then the "default" return values you will receive are "unknown" for string, -1 for number, and false for boolean. Arrays and Objects will be empty ([] and {} respectively).

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.

Method Return Type iOS Android
getAndroidId() string
getApiLevel() number
getApplicationName() string
getAvailableLocationProviders() Object 🚧 🚧
getBaseOs() string
getBuildId() string
getBatteryLevel() string
getBootloader() string 🚧 🚧
getBrand() string
getBuildNumber() string
getBundleId() string
isCameraPresent() boolean 🚧 🚧
getCarrier() string 🚧 🚧
getCodename() string 🚧 🚧
getDevice() string 🚧 🚧
getDeviceId() string 🚧 🚧
getDeviceType() string 🚧 🚧
getDisplay() string 🚧 🚧
getDeviceName() string
getDeviceToken() string
getFirstInstallTime() number 🚧 🚧
getFingerprint() string
getFontScale() number 🚧 🚧
getFreeDiskStorage() number 🚧 🚧
getFreeDiskStorageOld() number 🚧 🚧
getHardware() string 🚧 🚧
getHost() string 🚧 🚧
getIpAddress() string
getIncremental() string 🚧 🚧
getInstallerPackageName() string 🚧 🚧
getInstallReferrer() string 🚧 🚧
getInstanceId() string 🚧 🚧
getLastUpdateTime() number 🚧 🚧
getMacAddress() string 🚧 🚧
getManufacturer() string
getMaxMemory() number 🚧 🚧
getModel() string
getPhoneNumber() string 🚧 🚧
getPowerState() object 🚧 🚧
getProduct() string 🚧 🚧
getPreviewSdkInt() number 🚧 🚧
getReadableVersion() string 🚧 🚧
getSerialNumber() string 🚧 🚧
getSecurityPatch() string
getSystemAvailableFeatures() string[] 🚧 🚧
getSystemName() string 🚧 🚧
getSystemVersion() string 🚧 🚧
getTags() string 🚧 🚧
getType() string 🚧 🚧
getTotalDiskCapacity() number 🚧 🚧
getTotalDiskCapacityOld() number 🚧 🚧
getTotalMemory() number 🚧 🚧
getUniqueId() string 🚧 🚧
getUsedMemory() number 🚧 🚧
getUserAgent() string 🚧 🚧
getVersion() string 🚧 🚧
getBrightness() number 🚧 🚧
hasGms() boolean 🚧 🚧
hasHms() boolean 🚧 🚧
hasNotch() boolean 🚧 🚧
hasSystemFeature() boolean 🚧 🚧
isAirplaneMode() boolean 🚧 🚧
isBatteryCharging() boolean 🚧 🚧
isEmulator() boolean 🚧 🚧
isKeyboardConnected() boolean 🚧 🚧
isLandscape() boolean 🚧 🚧
isLocationEnabled() boolean 🚧 🚧
isMouseConnected() boolean 🚧 🚧
isHeadphonesConnected() boolean 🚧 🚧
isPinOrFingerprintSet() boolean 🚧 🚧
isTablet() boolean 🚧 🚧
isTabletMode() boolean 🚧 🚧
supported32BitAbis() string[] 🚧 🚧
supported64BitAbis() string[] 🚧 🚧
supportedAbis() string[] 🚧 🚧
syncUniqueId() string 🚧 🚧

Thanks to these libraries & their authors:

The initial work done by authors of the following libraries has helped a lot in keeping this repo updated.

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

About

Device Information For React Native Through JSI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published