1.0.0 • Published 12 months ago

@rn-common/device-info v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
12 months ago

@rn-common/device-info

Overview

This module provides utility functions to retrieve information about the device and the application. It leverages the expo-device and expo-application libraries to access various details such as device name, model, operating system, app version, and more.

Installation

Install using npm:

npm install @rn-common/device-info

or yarn:

yarn add @rn-common/device-info

Functions

1. getDeviceInfo

Retrieves detailed information about the device.

Returns:

  • DeviceInfo: An object containing device-related information.

Structure of DeviceInfo object:

  • deviceName (string): The name of the device.
  • modelName (string): The model name of the device.
  • os (string): The operating system of the device.
  • osVersion (string): The version of the operating system.

Example:

import { getDeviceInfo } from '@rn-common/device-info'

const deviceInfo = getDeviceInfo()
console.log(deviceInfo)

2. getAppInfo

Retrieves detailed information about the application.

Returns:

  • AppInfo: An object containing application-related information.

Structure of AppInfo object:

  • name (string): The name of the application.
  • version (string): The native version of the application.
  • buildNumber (string): The native build version of the application.
  • appId (string): The application ID.

Example:

import { getAppInfo } from '@rn-common/device-info'

const appInfo = getAppInfo()
console.log(appInfo)
1.0.0

12 months ago